Country

LOCALE_CODE_ALPHA_2

) is export { given $codeset { return %code2ToCountry.keys when LOCALE_CODE_ALPHA_2; return %code3ToCountry.keys when LOCALE_CODE_ALPHA_3; return %codeNumToCountry.keys when LOCALE_CODE_NUMERIC; return map({"\.$_".lc}, %code2ToCountry.keys) when LOCALE_CODE_DOM; } }

LOCALE_CODE_ALPHA_2

) is export { my $country = codeToCountry($code); return Any if (!$country); return countryToCode($country, $codesetOut); }

LOCALE_CODE_ALPHA_2

) is export { my $commonName = $country.uc; my $lookup;

LOCALE_CODE_ALPHA_2

) { given $codesetOut { when LOCALE_CODE_ALPHA_2 { return %countryToCode2{$country.uc}; } when LOCALE_CODE_ALPHA_3 { return %countryToCode3{$country.uc}; } when LOCALE_CODE_NUMERIC { return %countryToCodeNum{$country.uc}; } when LOCALE_CODE_DOM { my $dom = %countryToCode2{$country.uc}; return Any if (!$dom); $dom = $dom.lc; $dom = "uk" if ($dom eq "gb"); return ".$dom"; } } }

Locale::Codes::Country v0.0.1

A pure Raku library implementing the ISO-3166 standard

Authors

  • Dean Powell

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Locale::Codes::Country

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.