File Coverage

blib/lib/WWW/Search/Null.pm
Criterion Covered Total %
statement 20 24 83.3
branch 0 2 0.0
condition n/a
subroutine 6 7 85.7
pod n/a
total 26 33 78.7


line stmt bran cond sub pod time code
1              
2             =head1 NAME
3              
4             WWW::Search::NULL - class for searching any web site
5              
6             =head1 SYNOPSIS
7              
8             require WWW::Search;
9             $search = new WWW::Search('Null');
10              
11             =head1 DESCRIPTION
12              
13             This class is a specialization of WWW::Search that only returns an
14             error message.
15              
16             This class exports no public interface; all interaction should be done
17             through WWW::Search objects.
18              
19             This modules is really a hack for systems that want to include
20             indices that have no corresponding WWW::Search module (like UNIONS)
21              
22             =head1 AUTHOR
23              
24             C is written by Paul Lindner,
25              
26             =head1 COPYRIGHT
27              
28             Copyright (c) 1998 by the United Nations Administrative Committee
29             on Coordination (ACC)
30              
31             All rights reserved.
32              
33             =cut
34              
35             package WWW::Search::Null;
36              
37 2     2   1855 use strict;
  2         5  
  2         62  
38 2     2   11 use warnings;
  2         4  
  2         55  
39              
40 2     2   11 use base 'WWW::Search';
  2         3  
  2         185  
41              
42 2     2   13 use Carp ();
  2         4  
  2         33  
43 2     2   453 use WWW::SearchResult;
  2         5  
  2         399  
44              
45             our
46             $VERSION = do { my @r = (q$Revision: 1.6 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
47              
48             sub _native_setup_search
49             {
50 1     1   1 my $self = shift;
51 1         4 my ($native_query, $native_opt) = @_;
52 1         2 my $native_url;
53 1         2 $self->{_next_to_retrieve} = 0;
54 1         3 $self->{_base_url} = $self->{_next_url} = $native_url;
55             } # _native_setup_search
56              
57             sub _native_retrieve_some
58             {
59 0     0     my $self = shift;
60             # Null search just returns an error..
61 0 0         return if (!defined($self->{_next_url}));
62 0           my $response = new HTTP::Response(500, "This is a dummy search engine.");
63 0           $self->{response} = $response;
64             } # _native_retrieve_some
65              
66             1;
67              
68             __END__