Locale::US(3pm)

Locale::US3pm

Two letter codes for state identification in the united states and vice versa.

Usage

  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;

Abstract

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

Overview

Mapping

$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.

Dumping

$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.

Known bugs and limitations

•

The state name is returned in "uc()" format.

•

neither hash is strict, though they should be.

Releases

9 releases since Debian 5.0 (Lenny); the text changed 4 times.

  1. 5.0–6.0
  2. 7–8
  3. 9–10
  4. 11
  5. 12–13

Author

Currently maintained by Mike Accardo, <[email protected]>

Original author T. M. Brannon

Patches

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

From liblocale-us-perl 3.04-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.