Debian Codegraph @

lib/WWW/Search/Null.pm

raw
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<WWW::Search::Null> is written by Paul Lindner, <[email protected]>
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 use strict;
38 use warnings;
39
40 use base 'WWW::Search';
41
42 use Carp ();
43 use WWW::SearchResult;
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 my $self = shift;
51 my ($native_query, $native_opt) = @_;
52 my $native_url;
53 $self->{_next_to_retrieve} = 0;
54 $self->{_base_url} = $self->{_next_url} = $native_url;
55 } # _native_setup_search
56
57 sub _native_retrieve_some
58 {
59 my $self = shift;
60 # Null search just returns an error..
61 return if (!defined($self->{_next_url}));
62 my $response = new HTTP::Response(500, "This is a dummy search engine.");
63 $self->{response} = $response;
64 } # _native_retrieve_some
65
66 1;
67
68 __END__
69