#!/usr/bin/perl -w use strict; use Locale::SubCountry; use Data::Dumper qw(Dumper); #Create an object representing a certain country my $subcountry = Locale::SubCountry->new('US'); #Query to find this country's subcountries. my %states = $subcountry->code_full_name_hash; #Prints the name/code pairs for every US state print Dumper(\%states); __END__