What do you mean, "download the postal code data"?
I tried this module, I installed it, using WHM (a cPanel Product) with the Install a Perl Module, it appeared to work ok, however, when I use the 'sample' code:
use Geo::PostalCode;
my $gp = Geo::PostalCode->new(db_dir => ".");
my $record = $gp->lookup_postal_code(postal_code => '07302');
my $lat = $record->{lat};
my $lon = $record->{lon};
my $city = $record->{city};
my $state = $record->{state};
my $distance = $gp->calculate_distance(postal_codes => ['07302','100
+04']);
$record = $gp->lookup_city_state(city => "Jersey City",state => "NJ"
+);
$lat = $record->{lat};
$lon = $record->{lon};
my $postal_codes = $record->{postal_codes};
$postal_codes = $gp->nearby_postal_codes(lat => $lat, lon => $lon,
distance => 50);
print 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~;
(ran as a test) and I had this 'output':
City is
State is
Latitude is
Longitude is
Nearby Zips are: ARRAY(0x8674890)
So, could what you said, be the reason why it's not working?
I would appreciate your help.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.