By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,200 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

Postal / Zip Code Validation

P: 6
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 programmatically using perl script or javascript preferablly.


Thanks.
May 23 '08 #1
Share this Question
Share on Google+
4 Replies


nithinpes
Expert 100+
P: 410
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 programmatically 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.,
Expand|Select|Wrap|Line Numbers
  1. my %zip_code;
  2. $zip_code{Spain} = 'xxxxx' ;
  3.  
May 23 '08 #2

nithinpes
Expert 100+
P: 410
That's the generic way of doing it. But I believe, there should be specific modules available in CPAN for the purpose.
May 23 '08 #3

eWish
Expert 100+
P: 971
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
May 23 '08 #4

numberwhun
Expert Mod 2.5K+
P: 3,503
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.
Feb 1 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.