Postal / Zip Code Validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • racshah
    New Member
    • Apr 2008
    • 6

    Postal / Zip Code Validation

    Hi

    I have been asked to validate postal/zip codes against the countries like Netherland, United Kingdom, Spain, Italy, Belgium etc. Can anyone suggest that how can I do it programmaticall y using perl script or javascript preferablly.


    Thanks.
  • nithinpes
    Recognized Expert Contributor
    • Dec 2007
    • 410

    #2
    Originally posted by racshah
    Hi

    I have been asked to validate postal/zip codes against the countries like Netherland, United Kingdom, Spain, Italy, Belgium etc. Can anyone suggest that how can I do it programmaticall y using perl script or javascript preferablly.


    Thanks.
    In Perl, you can make use of hash. Store the country names and zip codes in hash as keys and values respectively. For ex.,
    Code:
    my %zip_code;
    $zip_code{Spain} = 'xxxxx' ;

    Comment

    • nithinpes
      Recognized Expert Contributor
      • Dec 2007
      • 410

      #3
      That's the generic way of doing it. But I believe, there should be specific modules available in CPAN for the purpose.

      Comment

      • eWish
        Recognized Expert Contributor
        • Jul 2007
        • 973

        #4
        racshah

        Please do not double post your questions. Please read the Posting Guidelines before making addiitonal posts. Your other thread has been deleted.

        Thank You!

        Kevin

        Comment

        • numberwhun
          Recognized Expert Moderator Specialist
          • May 2007
          • 3467

          #5
          ptpro,

          The topic that you are replying to is about a year and half old. That said, I doubt the OP is still working on this. While I thank you for the information (as I will probably peruse it), please keep in mind the age of the post you are replying to.

          Regards,

          Jeff


          UPDATE: ptpro: I don't know if you have gone to this site recently, but if you do, you will be presented with the following message:

          This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.
          Might want to test those links first.
          Last edited by numberwhun; Feb 1 '10, 10:08 PM. Reason: update

          Comment

          Working...