=head1 SYNOPSIS
use Locale::Country;
-
+
$country = code2country('jp'); # $country gets 'Japan'
$code = country2code('Norway'); # $code gets 'no'
-
+
@codes = all_country_codes();
@names = all_country_names();
-
+
# add "uk" as a pseudo country code for United Kingdom
Locale::Country::_alias_code('uk' => 'gb');
code for United Kingdom, use the following:
use Locale::Country;
-
+
Locale::Country::_alias_code('uk' => 'gb');
With this code, both "uk" and "gb" are valid codes for United Kingdom,
country name:
$| = 1; # turn off buffering
-
+
print "Enter country code: ";
chop($code = <STDIN>);
$country = code2country($code, LOCALE_CODE_ALPHA_2);