in reply to Mapping results of a Function

FTFY, you need to pass $_ to full_name so it knows what subcountry you want to look up.

use strict; use warnings; use Data::Dumper; use Locale::SubCountry; my $country = new Locale::SubCountry('United States'); my @states = $country->all_codes; my @list; my %state_hash = $country->code_full_name_hash; our $subcountry = do { @list = map { { code => uc($_), name => $country->full_name($_ +) }} + @states; }; print Dumper(\@list);

Replies are listed 'Best First'.
Re^2: Mapping results of a Function
by PerlSufi (Friar) on Jun 17, 2014 at 16:32 UTC