Geo::States - Lookup states and capitals by state names or abbreviations
use Geo::States;
my $COUNTRY = 'US' || 'CA';
my $geo = Geo::States->new($COUNTRY);
say $geo->find('TN')->text; # Tennessee
say $geo->find('Tennessee')->text; # TN
say $geo->find('TN')->capital; # Nashville
Geo::States will find a US or Canadian state/province (by name or abbreviation) and return an object with two subroutines:
-
text()
The text of the state. If given full name, text() will return the abbreviation, and vice versa.
-
capital()
Returns the capital name of the given state
Curtis Brandt curtis@cpan.org
Copyright (C) <2014> Curtis Brandt curtis@cpan.org
MIT license. See LICENSE file for details.