Can't say if its more efficient, but you could use List::Util::reduce.
use List::Util 'reduce'; my @a = ( 1, 2, 3, 4, 5 ); print reduce{ $a * $b } @a; 120
In reply to Re: Product of a list of numbers?
by BrowserUk
in thread Product of a list of numbers?
by ruffer_rinsin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |