Geo::Address::Mail::Standardizer::USPS::AMS - address standardization using the United States Postal Service Address Matching System
my $ms = new Geo::Address::Mail::Standardizer::USPS::AMS; my $addr = new Geo::Address::Mail::US; my $res = $ms->standardize($addr); $addr = $res->standardized_address or die 'unable to standardize address: ' . $res->error;
by default, the USPS::AMS standardizer assumes AMS paths are configured as follows:
datadir: /usr/share/uspsams statedir: /var/lib/uspsams AMS: datadir/comm DPV: datadir/dpv ELOT: datadir/elot LACSLink: datadir/lacslink SUITELink: datadir/suitelink Z4CXLOG.DAT: statedir/Z4CXLOG.DAT
you may change datadir or statedir via those attributes, but the other paths are computed and are immutable.
the Geo::Address::Mail::Standardizer::USPS::AMS constructor accepts two arguments:
the path to the USPS AMS shared data directory. this directory typically contains all of the database files provided with AMS.
the path to the USPS AMS state directory. this directory is expected to contain the Z4CXLOG.DAT date/time file that is written to by AMS. i have no idea what its purpose is; AMS won't initialize without it though.
initializes the AMS database. called during construction by the BUILD method.
attempt to standardize an address. the standardize method accepts a hashref or a Geo::Address::Mail::US object. a results object will be returned. see the documentation for Geo::Address::Mail::Standardizer::USPS::AMS::Results for details on the results object.
Mike Eldridge <diz@cpan.org>
Copyright (c) 2010 Mike Eldridge
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Geo::Address::Mail::Standardizer::USPS::AMS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Address::Mail::Standardizer::USPS::AMS
CPAN shell
perl -MCPAN -e shell install Geo::Address::Mail::Standardizer::USPS::AMS
For more information on module installation, please visit the detailed CPAN module installation guide.