Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: map sub to list?

by Arunbear (Prior)
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]
[Corion]: A good morning to you too, Discipulus!
[Discipulus]: ah! buran stroke again?
[choroba]: Not sure what meteorological event it's been, but it's -6 now and lots of snow around.

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2018-03-19 08:06 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (236 votes). Check out past polls.