Re: ITP: liblocale-us-perl -- Module for United States state identification
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/17/07 18:51, Matt Brown wrote:
> On 11/17/07, Ron Johnson <ron.l.johnson@cox.net> wrote:
>>> This Perl module provides methods allowing United States' two-letter
>>> state identification parsing from state code to state name and vice
>>> versa.
>> Is a package really needed for something this simple?
>
> It might be obvious to a US native, but it's hardly simple or obvious
> to those of us outside America.
It's not the *need* for a lookup table, it's the need for such a
small package. See below.
> MI is a prime example, does it refer to Michigan, Missouri,
> Mississippi or Minesota? The first two letters match all four.
Don't forget the Marshall Islands!
AL - Alaska or Alabama?
AR - Arizona or Arkansas?
CO - Colorado or Connecticut?
MA - Maine, Marshall Islands, Maryland, Massachusetts?
NE - Nebraska or Nevada?
> If you come across this every day you probably know the answer, but I
> just had to look it up again (Michigan) despite being caught out by
> this just the other week!
But it's just (or should be) a couple of 65-element (50 states, DC,
Puerto Rico, Virgin Islands, and various Pacific islands) hash
tables wrapped around a couple of simple functions.
http://www.usps.com/ncsc/lookups/abbr_state.txt
What would be much more useful (still simple, but with much more
data) is a world-wide hash table of countries and states/provinces.
And wouldn't you know it... there's already a CPAN module to do just
that: Locale::SubCountry.
http://search.cpan.org/~kimryan/Locale-SubCountry-1.38/lib/Locale/SubCountry.pm
- --
Ron Johnson, Jr.
Jefferson LA USA
%SYSTEM-F-FISH, my hovercraft is full of eels
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHP0R8S9HxQb37XmcRAiA2AJ9yhYepslZJCedRRxeLtverXuP2RQCggl/G
jffLA1E9WM2wK00R4LZehYw=
=UNmC
-----END PGP SIGNATURE-----
Reply to: