map does, indeed, evaluate its BLOCK in list context. This is so you can say stuff like
my $n=0; my %position = map {$_ => $n++} @list
The simple fix is to make your block evaluate reverse in scalar context: map { scalar reverse($_) } @list.
In reply to Re: Bug? with reverse in map
by ariels
in thread Bug? with reverse in map
by strat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |