Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by toolic (Bishop)
on Aug 09, 2010 at 21:20 UTC ( [id://853918]=note: print w/replies, xml ) Need Help??


in reply to simultaneously adding and multiplying numbers in a hash/ array

The following will accumulate the product every time through the loop.
$product += $v1*$k1
Assignment Operators
  • Comment on Re: simultaneously adding and multiplying numbers in a hash/ array
  • Download Code

Replies are listed 'Best First'.
Re^2: simultaneously adding and multiplying numbers in a hash/ array
by derpp (Acolyte) on Aug 09, 2010 at 21:22 UTC
    Thanks! I can't believe the answer was so simple..

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found