in reply to Parsing an Mailing Addresss

I number of years ago I was searching for just such a tool. What we ended up using was a product called the Postalsoft ACE library from Firstlogic. It is a C library and a database (about 650 MB). Data updates come every 2 months which you must apply or you cannot get CASS certified.
With this tool you can correct and encode any US address (they also have international and canadian libraries). Since this library is in C I was forced to build an xs extention. An example of the interface is...
use ACE; $ah = ACE->open("/u02/postalsoft/ace.cfg"); $ah->set_input_fields('discrete'); $ah->want_all_components(); $addr = '101 morris'; $city = 'sbastopul'; $state = 'CA'; $zip = ''; %a = $ah->find($addr, $city, $state, $zip); for my $key (qw(ADDRESS CITY ZIP ZIP4 COUNTY COUNTYNAME)) { print "$key = $a{$key}\n" if $a{$key}; } $ah->close();
This will produce output like ...
ADDRESS = 101 MORRIS ST
CITY = SEBASTOPOL
ZIP = 95472
ZIP4 = 3858
COUNTY = 097
COUNTYNAME = SONOMA
Note that the software fixed the street name, corrected the spelling of the city and added zip4, county and countyname fields.

I have never posted this code to CPAN because I've never looked into the legal issues. Postalsoft is not free. Our license fees are several thousand dollars a year. If you are interested in more details you can message me.