in reply to Perl-ish way to create hash from array
Or you could use an explicit iterator with a do to limit scope:my %csvColumns = map {$csvColumns[$_] => $_} 0 .. $#csvColumns;
I know lots of folks would describe those as Perlier, though would not be using the phrase in a positive way.my %csvColumns = do {my $i = 0; map {$_ => $i++} @csvColumns};
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|