The expected output is:$a = [[0]]; foreach (@$a) { $_++ foreach @$_ } print $a->[0][0],$/; $_++ for map @$_, @{$a}; print $a->[0][0],$/; __END__ 1 1
The strange thing is that the extra list flattening with map() doesn't work. I don't see any reason why it shouldn't. I guess the question is: is this a bug or not?1 2
Liz
Update:
Not a bug, just copying of the list with map(). Thanks to !1, blokhead and holo for the enlightenment.
In reply to $_ and list flattening with map() by liz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |