Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: map confusion

by Cristoforo (Curate)
on Dec 16, 2015 at 00:12 UTC ( [id://1150431]=note: print w/replies, xml ) Need Help??


in reply to map confusion

As GrandFather said, $_ gets passed to @incremented before its incremented.

From the docs for map: Note that $_ is an alias to the list value, so it can be used to modify the elements of the LIST. That explains why the original elements in @array change. $_++ modifies the element $_ and $_ * 2 doesn't modify $_.

Replies are listed 'Best First'.
Re^2: map confusion
by Anonymous Monk on Dec 16, 2015 at 00:43 UTC

    Thanks Monks. Got it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found