Given:
use strict; my @list = (1,2,3,4,5); my $result = 1; map {$result *= $_} @list; print $result;
I realize that TIMTOWTDI, but is this a good place to use map, is the loop preferable, or are they about the same?
There is no emoticon for what I'm feeling now.
In reply to Re: Product of a list of numbers?
by Popcorn Dave
in thread Product of a list of numbers?
by ruffer_rinsin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |