GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Locale::US(3) User Contributed Perl Documentation Locale::US(3)

Locale::US - Two letter codes for state identification in the United States and vice versa.

  use Locale::US;
 
  my $u = Locale::US->new;

  my $state = $u->{code2state}{$code};
  my $code  = $u->{state2code}{$state};

  my @state = $u->all_state_names;
  my @code  = $u->all_state_codes;

Map from US two-letter codes to states and vice versa.

$self->{code2state}

This is a hashref which has two-letter state names as the key and the long name as the value.

$self->{state2code}

This is a hashref which has the long nameas the key and the two-letter state name as the value.

$self->all_state_names

Returns an array (not arrayref) of all state names in alphabetical form

$self->all_state_codes

Returns an array (not arrayref) of all state codes in alphabetical form.

  • The state name is returned in "uc()" format.
  • neither hash is strict, though they should be.

Locale::Country

<http://www.usps.gov/ncsc/lookups/usps_abbreviations.htm>

    Online file with the USPS two-letter codes for the United States and its possessions.

    lynx -dump http://www.usps.gov/ncsc/lookups/usps_abbreviations.htm > kruft.txt
    kruft2codes.pl

Currently maintained by Mike Accardo, <accardo@cpan.org>

Original author T. M. Brannon

Thanks to stevet AT ibrinc for a patch about second call to new failing.

    Copyright (c) 2015 Mike Accardo
    Copyright (c) 2002-2014 Terrence Brannon

All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2015-08-31 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.