NAME

Business::USPS::WebTools::CityStateLookup - lookup a City and State by Zip Code

SYNOPSIS

use Business::USPS::WebTools::AddressStandardization;

my $looker_upper = Business::USPS::WebTools::CityStateLookup->new( {
	UserID   => $ENV{USPS_WEBTOOLS_USERID},
	Password => $ENV{USPS_WEBTOOLS_PASSWORD},
	Testing  => 1,
	} );
	
my $hash = $looker_upper->lookup_city_state(
	);

if( $looker_upper->is_error )
	{
	warn "Oh No! $looker_upper->{error}{description}\n";
	}
else
	{
	print join "\n", map { "$_: $hash->{$_}" } 
		qw(FirmName Address1 Address2 City State Zip5 Zip4);
	}
	
	

DESCRIPTION

*** THIS IS ALPHA SOFTWARE ***

This module implements the Address Standardization web service from the US Postal Service. It is a subclass of Business::USPS::WebTools.

lookup_city_state( KEY, VALUE, ... )

The verify_address method takes the following keys, which come directly from the USPS web service interface:

FirmName	The name of the company
Address1	The suite or apartment
Address2	The street address
City		The name of the city
State		The two letter state abbreviation
Zip5		The 5 digit zip code
Zip4		The 4 digit extension to the zip code

It returns an anonymous hash with the same keys, but the values are the USPS's canonicalized address. If there is an error, the hash values will be the empty string, and the error flag is set. Check is with is_error:

$verifier->is_error;

See the is_error documentation in Business::USPS::WebTools for more details on error information.

TO DO

SEE ALSO

Business::USPS::WebTools

The WebTools API is documented on the US Postal Service's website:

http://www.usps.com/webtools/htm/Address-Information.htm

SOURCE AVAILABILITY

This source is part of a SourceForge project which always has the latest sources in CVS, as well as all of the previous releases.

http://sourceforge.net/projects/brian-d-foy/

If, for some reason, I disappear from the world, one of the other members of the project can shepherd this module appropriately.

AUTHOR

brian d foy, <bdfoy@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 2006, brian d foy, All Rights Reserved.

You may redistribute this under the same terms as Perl itself.