It amazes me how many people don't know their own address! We have nearly 30,000 members in our database and are growing every day. I need to validate their address because when we go to ship them their product, we get errors. For instance, I got and Address in Estonia where they put the country as United States. The Zip code they put as 74117, my only check for United States is the zip code, but 74117 is in a valid format.

I have searched everywhere, including cpan for a module. My head is starting to hurt, I've spent hours on this and cannot find a good way to do it other than use LWP and just get a page off usps.com and then parse the HTML to find success or not... That could easily break by them just making a page change, so I need a different way to do it.

I would greatly appreciate any place you can point me to that has a solution.

We ship worldwide, except to Ghana and Nigeria... due to the amount of fraud we have received from there.

So I really need a solution that is not limited to the United States.

Thanks in advance for reading and for any pointers you have.

Update: We use USPS for our mailing, but we did just setup an account with UPS, and I found a module (Net::UPS) that will integrate our UPS account with our site to validate the addresses...<br
thx,
Richard

In reply to validate a postal code by powerhouse

Title:
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, 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:
    & &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.