Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Square the array values.

by pajout (Curate)
on Mar 18, 2010 at 09:39 UTC ( #829359=note: print w/ replies, xml ) Need Help??


in reply to Square the array values.

Though it could be considered ugly, map can help you:

pajout@balvan:~$ perl -e 'my @a = (1,2,3); print join(",", map {$_*$_} + @a)."\n";' 1,4,9


Comment on Re: Square the array values.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2015-07-29 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (261 votes), past polls