Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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 %

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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2016-10-27 05:28 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (353 votes). Check out past polls.