Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: simultaneously adding and multiplying numbers in a hash/ array

by AnomalousMonk (Bishop)
on Aug 09, 2010 at 22:12 UTC ( #853926=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    >perl -wMstrict -le
    "my @change         = (1.15, -0.1, 5.4, 1.03, 1.15, -0.241);
    ...
    "
    5 keys in hash (oops...)
    sum == 1866.16 (?)
    
  2. or download this
    >perl -wMstrict -le
    "use List::Util qw(sum);
    ...
     print qq{sum == $sum};
    "
    sum == 1406.16
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2022-08-19 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?