Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ferreira (5993)

ferreira
  (email not shown publicly)
http://www.ferreira.triang.net/

Just another Brazilian Perl hacker.

Journal of ferreira (5993)

Wednesday August 10, 2005
09:39 PM

Multi-national validation?!

[ #26231 ]
Think about it. You have an application which holds addresses in various parts of the world and want to make a minimum sanity check for post codes. Then you write:

  use Business::PostCode;
  # get adresses
  for (@addresses) {
     if (postcode_ok($_->country, $_->postcode)) {
       # ok, go on
     } else {
       # not ok, reject
     }
  }

and that's it!

Business::PostCode would integrate national modules like Business::BR::PostCode, Business::PT::PostCode, etc. to provide a worldly great benefit. That was a suggestion raised by _brian_d_foy after cog triggered a discussion on modules@perl.org about modules for validation. Was something like this attempted before? It seems to me Business::PostCode would be trivial provided Business::<Country>::PostCode modules with a common protocol.

What about other ideas for border-crossing Perl modules? Passport checking?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Would it be better if they were Business::PostCode::BR, Business::PostCode::PT?
    • Yep, from an international point of view. But from a country-wise perspective, Business::<Country>:: would be the easy way to find out the available validation modules of a certain country. International modules (like Business::PostCode) would cross borders by requiring Business::BR::PostCode, Business::PT::PostCode as needed. My guess is that using a bunch of modules within a certain country will be more common than multi-national modules. That's the rationale for making it obvious within the Busines