WWW::Search::Null::Error - class for testing WWW::Search clients


WWW-Search documentation Contained in the WWW-Search distribution.

Index


Code Index:

NAME

Top

WWW::Search::Null::Error - class for testing WWW::Search clients

SYNOPSIS

Top

  require WWW::Search;
  my $oSearch = new WWW::Search('Null::Error');
  $oSearch->native_query('Makes no difference what you search for...');
  $oSearch->retrieve_some();
  my $oResponse = $oSearch->response;
  # You get an HTTP::Response object with a code of 500

DESCRIPTION

Top

This class is a specialization of WWW::Search that only returns an error message.

This module might be useful for testing a client program without actually being connected to any particular search engine.

AUTHOR

Top

Martin 'Kingpin' Thurn, mthurn at cpan.org, http://tinyurl.com/nn67z.


WWW-Search documentation Contained in the WWW-Search distribution.

# $Id: Error.pm,v 1.11 2007/11/12 01:13:49 Daddy Exp $

package WWW::Search::Null::Error;

use strict;
use warnings;

use base 'WWW::Search';
our
$VERSION = do { my @r = (q$Revision: 1.11 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
our $MAINTAINER = q{Martin Thurn <mthurn@cpan.org>};

sub _native_setup_search
  {
  my($self, $native_query, $native_opt) = @_;
  } # native_setup_search


sub _native_retrieve_some
  {
  my $self = shift;
  my $response = new HTTP::Response(500,
                                    "This is a test of WWW::Search");
  $self->{response} = $response;
  return undef;
  } # native_retrieve_some


1;

__END__