Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
We don't bite newbies here... much
 
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 contemplating the Monastery: (6)
As of 2014-04-21 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (493 votes), past polls