The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WWW::Search::Scraper::ZIPplus4 - Get ZIP+4 code, given street address, from www.usps.com. Also helps de-duplicate a mailing list (see eg/ZipPlus4.pl)

SYNOPSIS

Simple
 use WWW::Search::Scraper(qw(1.48));
 use WWW::Search::Scraper::Request::ZIPplus4;

 my $ZIPplus4 = new WWW::Search::Scraper(
         'ZIPplus4',
        ,{   'Delivery_Address' => '1600 Pennsylvannia Ave'
            ,'City'             => 'Washington'
            ,'State'            => 'DC'
            ,'Zip_Code'         => '20500'
         } );

 while ( my $response = $ZIPplus4->next_response() )
 {    
     print $response->zip()."\n";
 }
Complete
 use WWW::Search::Scraper(qw(1.48));
 use WWW::Search::Scraper::Request::ZIPplus4;

 my $ZIPplus4 = new WWW::Search::Scraper( 'ZIPplus4' );

 my $request = new WWW::Search::Scraper::Request::ZIPplus4;
 
 # Note: Delivery_Address(), and either Zip_Code(), or City() and State(), are required.
 $request->Delivery_Address('1600 Pennsylvannia Ave');
 $request->City('Washington');
 $request->State('DC');
 $request->Zip_Code('20500');

 $ZIPplus4->scraperRequest($request);
 while ( my $response = $ZIPplus4->next_response() )
 {    
     for ( qw(address city state zip county carrierRoute checkDigit deliveryPoint) ) {
         print "$_: ".${$response->$_()}."\n";
     }
 }

DESCRIPTION

This class is an ZIPplus4 specialization of WWW::Search. It handles making and interpreting ZIPplus4 searches http://www.ZIPplus4.com.

AUTHOR and CURRENT VERSION

WWW::Search::Scraper::ZIPplus4 is written and maintained by Glenn Wood, http://search.cpan.org/search?mode=author&query=GLENNWOOD.

COPYRIGHT

Copyright (c) 2001 Glenn Wood All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.