Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?

by ysth (Canon)
on Nov 04, 2003 at 09:13 UTC ( [id://304357]=note: print w/replies, xml ) Need Help??


in reply to Re: How can I add all the numbers in an array with out doing a foreach loop?
in thread How can I add all the numbers in an array with out doing a foreach loop?

List::Util also has a sum():
use List::Util 'sum'; @a = 1..10; $sum = sum(@a);
  • Comment on Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-16 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found