Why does:
my @keys = qw{ a b c d }; my %hash = map { $_++ } @keys;
Produce the following warning:
Odd number of elements in hash assignemnt.
while the following does not:
my %hash; foreach ( @keys ) { $hash{$_}++; }
I thought the map method was just a short hand way of using a loop?
Thanks in advance - njcodewarrior
In reply to Hash assignments using map by njcodewarrior
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |