draco_iii has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (arrays)
That is, I want to avoid having to write any kind of explicit loop, such as:
I'd rather do it in a single statement. Of course, I could wrap the above in a sub, but are there any better ways?my $sum = 0; for ( @numbers ) { $sum += $_; }
Originally posted as a Categorized Question.
Back to
Seekers of Perl Wisdom