Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: map sub to list?

by Arunbear (Parson)
on Sep 09, 2013 at 16:58 UTC ( #1053044=note: print w/ replies, xml ) Need Help??

in reply to map sub to list?

If you're just adding 1 to each element then defining a separate sub is overkill:

% perl -de0 Loading DB routines from version 1.32 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> @a = (1, 2, 3) DB<2> x @a 0 1 1 2 2 3 DB<3> x map { $_ + 1 } @a 0 2 1 3 2 4 DB<4> q %

Comment on Re: map sub to list?
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2015-11-30 14:37 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (772 votes), past polls