The output should be aaabbbcccdddeee, notaaa555234dddeee
perl -wle'
map { for (my $i =2; $i <5; $i++) { push @a, $_ } } "a".."e";
print @a
'
aaa555234dddeee
expected behavior only when passing / dereferencing a variable $_,
perl -wle'
map { for (my $i =2; $i <5; $i++) { push @a, ${\$_} } } "a".."e";
print @a
'
aaabbbcccdddeee
Is this a documented error (or function)?
Dry27 source
share