Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: map and undef - odd behaviour with an array of arrays

by eyepopslikeamosquito (Canon)
on Dec 22, 2012 at 08:53 UTC ( #1009988=note: print w/ replies, xml ) Need Help??


in reply to Re^2: map and undef - odd behaviour with an array of arrays
in thread map and undef - odd behaviour with an array of arrays

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.


Comment on Re^3: map and undef - odd behaviour with an array of arrays
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009988]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2015-03-04 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (111 votes), past polls