.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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::AddressStandardization 3pm" .TH Business::US::USPS::WebTools::AddressStandardization 3pm "2021-05-20" "perl v5.32.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::AddressStandardization \- canonicalize a US address .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Business::US::USPS::WebTools::AddressStandardization; \& \& my $verifier = Business::US::USPS::WebTools::AddressStandardization\->new( { \& UserID => $ENV{USPS_WEBTOOLS_USERID}, \& Password => $ENV{USPS_WEBTOOLS_PASSWORD}, \& Testing => 1, \& } ); \& \& my $hash = $verifier\->verify_address( \& FirmName => \*(Aq\*(Aq, \& Address1 => \*(Aq\*(Aq, \& Address2 => \*(Aq6406 Ivy Lane\*(Aq, \& City => \*(AqGreenbelt\*(Aq, \& State => \*(AqMD\*(Aq, \& Zip5 => \*(Aq\*(Aq, \& Zip4 => \*(Aq\*(Aq, \& ); \& \& if( $verifier\->is_error ) \& { \& warn "Oh No! $verifier\->{error}{description}\en"; \& } \& else \& { \& print join "\en", map { "$_: $hash\->{$_}" } \& qw(FirmName Address1 Address2 City State Zip5 Zip4 DeliveryPoint CarrierRoute ReturnText); \& } .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 "verify_address( \s-1KEY, VALUE, ...\s0 )" 4 .IX Item "verify_address( 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, plus three additional keys: .Sp .Vb 3 \& DeliveryPoint The 2 digit extension to the ZIP+4 code \& CarrierRoute The 4 character postal carrier route \& ReturnText An error message when multiple addresses are found .Ve .Sp 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 .Vb 1 \& https://www.usps.com/business/web\-tools\-apis/address\-information\-api.pdf .Ve .SH "SOURCE AVAILABILITY" .IX Header "SOURCE AVAILABILITY" This source is in GitHub: .PP .Vb 1 \& https://github.com/ssimms/business\-us\-usps\-webtools .Ve .SH "AUTHOR" .IX Header "AUTHOR" brian d foy .SH "MAINTAINER" .IX Header "MAINTAINER" Steve Simms .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright © Steve Simms. All rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.