line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Empty.pm,v 1.10 2010-12-02 23:45:57 Martin Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
WWW::Search::Null::Empty - class for testing WWW::Search clients |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use WWW::Search; |
10
|
|
|
|
|
|
|
my $oSearch = new WWW::Search('Null::Empty'); |
11
|
|
|
|
|
|
|
$oSearch->native_query('Makes no difference what you search for...'); |
12
|
|
|
|
|
|
|
my @aoResults = $oSearch->results; |
13
|
|
|
|
|
|
|
# You get no results... |
14
|
|
|
|
|
|
|
my $oResponse = $oSearch->response; |
15
|
|
|
|
|
|
|
# ...But you get an HTTP::Response object with a code of 200 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This class is a specialization of WWW::Search that returns no hits, |
20
|
|
|
|
|
|
|
but no error message. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
This module might be useful for testing a client program without |
23
|
|
|
|
|
|
|
actually being connected to any particular search engine. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 AUTHOR |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Martin 'Kingpin' Thurn, C, L. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
package WWW::Search::Null::Empty; |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
3
|
|
3084
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
90
|
|
34
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
84
|
|
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
3
|
|
33
|
use base 'WWW::Search'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
761
|
|
37
|
|
|
|
|
|
|
our |
38
|
|
|
|
|
|
|
$VERSION = do { my @r = (q$Revision: 1.10 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; |
39
|
|
|
|
|
|
|
our $MAINTAINER = q{Martin Thurn }; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _native_setup_search |
42
|
|
|
|
|
|
|
{ |
43
|
4
|
|
|
4
|
|
19
|
my($self, $native_query, $native_opt) = @_; |
44
|
|
|
|
|
|
|
} # native_setup_search |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _native_retrieve_some |
48
|
|
|
|
|
|
|
{ |
49
|
2
|
|
|
2
|
|
29
|
my $self = shift; |
50
|
2
|
|
|
|
|
21
|
my $response = new HTTP::Response(200, |
51
|
|
|
|
|
|
|
"This is a test of WWW::Search"); |
52
|
2
|
|
|
|
|
149
|
$self->{response} = $response; |
53
|
2
|
|
|
|
|
11
|
return 0; |
54
|
|
|
|
|
|
|
} # native_retrieve_some |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |