| 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, <lindner@itu.int> | ||||||||||
| 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 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 38 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 39 | |||||||||||
| 40 | 1 | ▶ | use base 'WWW::Search'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 41 | |||||||||||
| 42 | 1 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 43 | 1 | ▶ | use WWW::SearchResult; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 44 | |||||||||||
| 45 | our | ||||||||||
| 46 | 1 | $VERSION = do { my @r = (q$Revision: 1.6 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; | |||||||||
| 47 | |||||||||||
| 48 | sub _native_setup_search | ||||||||||
| 49 | { | ||||||||||
| 50 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_native_setup_search: not called CC=1 SCAR=6.9
| |||||||||||
| 51 | 0 | my ($native_query, $native_opt) = @_; | |||||||||
| 52 | 0 | my $native_url; | |||||||||
| 53 | 0 | $self->{_next_to_retrieve} = 0; | |||||||||
| 54 | 0 | $self->{_base_url} = $self->{_next_url} = $native_url; | |||||||||
| 55 | } # _native_setup_search | ||||||||||
| 56 | |||||||||||
| 57 | sub _native_retrieve_some | ||||||||||
| 58 | { | ||||||||||
| 59 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_native_retrieve_some: not called CC=2 SCAR=17.9
| |||||||||||
| 60 | # Null search just returns an error.. | ||||||||||
| 61 | 0 | ▶ | return if (!defined($self->{_next_url})); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | 1; | |||||||||
| 67 | |||||||||||
| 68 | __END__ | ||||||||||