Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by AnomalousMonk (Archbishop)
on Aug 09, 2010 at 22:12 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-25 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found