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 reply to Re^3: map and undef - odd behaviour with an array of arrays
by eyepopslikeamosquito
in thread map and undef - odd behaviour with an array of arrays
by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |