Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Ok, I went through and ran every line of the code it said to do. on the first line, lwp-download... I got an error saying this:
lwp-download: Aborted Will not save <> as +"Geo-PostalCode\x5f19991101.txt.gz". Please override file name on the command line.
so I did it like this:  wget then did the rest like it said. I manually saved and uploaded all the installation files from here:

When I uploaded them the files in /t that end with .t somehow ended up with .t.txt file names so I had to rename those.

After all was said and done, I did a test with this 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...
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!";

Can you see a reason why this would not be working and failing at that location?

Thanks for any further assistance you can be. I will appreciate any and all advice on the matter.


In reply to Re^7: Zip Code Module? by powerhouse
in thread Zip Code Module? by powerhouse

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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, 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, 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (2)
    As of 2021-04-13 01:37 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found