I have the following code, which dies "no such file or directory" at
line 8.  The problem seems to be that the census data file it relies
on is a single .dbf, and the documentation seems to indicate that the
module looks for three separate .db files.  The .dbf file, though, is
the file from the working link in the docs, submitted by the author,
and doesn't seem to have changed since 1999, so I'm slightly
suspicious that, whatever the docs say, the error is in the way I'm
invoking it.  Does anyone have experience with this module?

__CODE__
#!/usr/bin/perl

use warnings;
use strict;
use Geo::PostalCode;

my $gp = Geo::PostalCode->new(db_dir => ".") or die "can't create
Geo::PostalCode object: $!\n" ;

my $record = $gp->lookup_city_state(city => "Jersey City", state =>
"NJ") or die "can't read from file: $!\n" ;

my $lat  = $record->{lat};
my $lon  = $record->{lon};

print "$lat $lon\n" ;

my $postal_codes = $gp->nearby_postal_codes(lat => $lat, lon => $lon,
distance => 50);

print map{"$_\n"} @$postal_codes ;
__END__

TIA,

--jay
[EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to