.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Business::US::USPS::WebTools::CityStateLookup 3pm" .TH Business::US::USPS::WebTools::CityStateLookup 3pm "2021-05-22" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Business::US::USPS::WebTools::CityStateLookup \- lookup a City and State by Zip Code .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Business::US::USPS::WebTools::AddressStandardization; \& \& my $looker_upper = Business::US::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}\en"; \& } \& else \& { \& print join "\en", map { "$_: $hash\->{$_}" } \& qw(FirmName Address1 Address2 City State Zip5 Zip4); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" *** \s-1THIS IS ALPHA SOFTWARE\s0 *** .PP This module implements the Address Standardization web service from the \&\s-1US\s0 Postal Service. It is a subclass of Business::US::USPS::WebTools. .IP "lookup_city_state( \s-1KEY, VALUE, ...\s0 )" 4 .IX Item "lookup_city_state( KEY, VALUE, ... )" The \f(CW\*(C`verify_address\*(C'\fR method takes the following keys, which come directly from the \s-1USPS\s0 web service interface: .Sp .Vb 7 \& 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 .Ve .Sp It returns an anonymous hash with the same keys, but the values are the \s-1USPS\s0'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 \f(CW\*(C`is_error\*(C'\fR: .Sp .Vb 1 \& $verifier\->is_error; .Ve .Sp See the \f(CW\*(C`is_error\*(C'\fR documentation in Business::US::USPS::WebTools for more details on error information. .SH "TO DO" .IX Header "TO DO" .SH "SEE ALSO" .IX Header "SEE ALSO" Business::US::USPS::WebTools .PP The WebTools \s-1API\s0 is documented on the \s-1US\s0 Postal Service's website: .PP https://www.usps.com/business/web\-tools\-apis/address\-information\-api.pdf .SH "SOURCE AVAILABILITY" .IX Header "SOURCE AVAILABILITY" This source is in GitHub: .PP .Vb 1 \& https://github.com/briandfoy/business\-us\-usps\-webtools .Ve .SH "AUTHOR" .IX Header "AUTHOR" brian d foy, \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright © 2006\-2016, brian d foy . All rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.