For anyone wishing to do this now, note that since version 1.35 (October 2013) List::Util has had a product function to perform precisely this task.
#!/usr/bin/env perl use strict; use warnings; use List::Util 1.35 'product'; my @a = (1, 2, 3, 4, 5); print product @a;
🦛
In reply to Re^2: Product of a list of numbers?
by hippo
in thread Product of a list of numbers?
by ruffer_rinsin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |