|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^3: map and undef - odd behaviour with an array of arraysby eyepopslikeamosquito (Canon) |
| on Dec 22, 2012 at 08:53 UTC ( #1009988=note: print w/ replies, xml ) | Need Help?? |
|
But why did map{undef $_}(@x) behave differently than undef @x?"undef @x" empties the array while "map{undef $_}@x" sets each element in the array to the value undef. Since your array had one element in it, that element was not deleted, rather its value was set to undef.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||