Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by borisz (Canon)
on Aug 16, 2006 at 09:48 UTC ( [id://567645]=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?

Just for fun, does the question make any sense?
use List::Util qw/reduce/; my $sum = reduce { $a + $b } 1..10;
Boris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found