Geo::PostalCode - Find closest zipcodes, distance, latitude, and longitude.
Geo::Postalcode is a module for calculating the distance between two postal codes. It can find the postal codes within a specified distance of another postal code or city and state. It can lookup the city, state, latitude and longitude by postal code.
The data is from the 1999 US Census database of U.S. Postal Codes, available from http://www.census.gov/geo/www/tiger/zip1999.html.
Returns a new Geo::PostalCode object using the postalcode.db, latlon.db, and city.db Berkeley Database files in $db_dir.
* state - State two-letter abbreviation.
Returns the distance in miles between the two postal codes in @postal_codes.
Returns an array reference containing postal codes with $distance miles of ($lat, $lon).
If $order_by is specified, then the records are sorted by the $order_by field.
This module is in early alpha stage. It is suggested that you look over the source code and test cases before using the module. In addition, the API is subject to change.
Thanks to Scott Gifford for contributing multiple bug fixes and code cleanup.