in reply to Re^6: Zip Code Module?
in thread Zip Code Module?
so I did it like this: wget http://tjmather.com/Geo-PostalCode_19991101.txt.gz then did the rest like it said. I manually saved and uploaded all the installation files from here: http://search.cpan.org/src/TJMATHER/Geo-PostalCode-0.06/lwp-download: Aborted Will not save <http://tjmather.com/Geo-PostalCode_19991101.txt.gz> as +"Geo-PostalCode\x5f19991101.txt.gz". Please override file name on the command line.
I added the 'die' parts for debugging because it was not working. I am getting this message: Could not Lookup Postal Code! So it is failing at this part of the code: $_record = $gp->lookup_postal_code('postal_code' => "$_zip") or die "Could not Lookup Postal Code!";use Geo::PostalCode; my ($lat, $lon, $city, $state, $distance, $_record, $_db_dir, $gp, + $_zip); $_db_dir = "/etc/zip/edgetest"; $gp = Geo::PostalCode->new(db_dir => $_db_dir) or die "Could not c +reate a New Instance!"; $_zip = param("zip"); $_record = $gp->lookup_postal_code('postal_code' => "$_zip") or di +e "Could not Lookup Postal Code!"; $lat = $_record->{lat}; $lon = $_record->{lon}; $city = $_record->{city}; $state = $_record->{state}; $distance = $gp->calculate_distance(postal_codes => ["$_zip",'7485 +1']) or die "Could not get distance 3!"; $postal_codes = $gp->nearby_postal_codes(lat => $lat, lon => + $lon, distance => 50); $_page_content .= qq~<br> City is ~ . $city . qq~<br> State is ~ . $state . qq~<br> Latitude is ~ . $lat . qq~<br> Longitude is ~ . $lon . qq~<br> <br> Nearby Zips are: ~ . @$postal_codes . qq~<br> <br> The Distance from $_zip to US is $distance miles<br> <br>~; # $_page_content is printed at the end of # the index.cgi file for the # content...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Zip Code Module?
by simonm (Vicar) on Dec 17, 2004 at 17:06 UTC | |
by powerhouse (Friar) on Dec 17, 2004 at 17:20 UTC | |
by simonm (Vicar) on Dec 17, 2004 at 21:23 UTC | |
by powerhouse (Friar) on Dec 18, 2004 at 22:08 UTC | |
by simonm (Vicar) on Dec 19, 2004 at 17:26 UTC |