NAME

Locale::BR - Identify Brazilian states by two-letter codes and vice-versa

SYNOPSIS

use Locale::BR  qw( :all );

my $state = code2state('RJ');    # 'Rio de Janeiro'
my $code  = state2code('Amapá'); # 'AM'

my @states = all_state_names();
my @codes  = all_state_codes();

EXPORT

This modules exports nothing by default, so you'll have to use the ':all' export tag in order to import the subroutines to your namespace. Or you can explicitly name any of the following subroutines:

code2state

Takes a state code and returns a string containing the name of the state. If the code is not a valid state code, returns undef.

This subroutine is case insensitive. For instance, 'mg', 'Mg', 'MG' and even 'mG' will all return 'Minas Gerais'.

state2code

Takes a state name and returns a string containing its respective code. If the name is not a valid state name, returns undef.

This subroutine is case insensitive and understands state names with and without accentuation. For instance, 'Amapá', 'amapá', 'Amapa' and 'amapa' will all return 'AP'.

all_state_names

Returns an alphabetically ordered list of all Brazilian state names.

all_state_codes

Returns an alphabetically ordered list of all Brazilian state codes.

SEE ALSO

Locale::Country

Locale::US

AUTHOR

Breno G. de Oliveira, <garu at cpan.org>

BUGS

Please report any bugs or feature requests to bug-locale-br at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Locale-BR. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Locale::BR

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2009 Breno G. de Oliveira.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.