http://qs1969.pair.com?node_id=323385

ruffer_rinsin has asked for the wisdom of the Perl Monks concerning the following question:

I would assume that this is a FAQ, but it seems to be impossible to get reasonable search results for overloaded terms like "perl product" or "multiply array."

At any rate, I have this procedure for multiplying a list of numbers:

sub product { my $list = shift; my $prod = 1; foreach my $num (@$list) { $prod *= $num; } return $prod; }

However, with the loop and all, it seems like a terribly inefficient method of doing such a thing. Anyone have a smarter way?