Anonymous user
Sum and product of an array: Difference between revisions
→{{header|Perl}}
No edit summary |
|||
Line 443:
$prod *= $_ foreach @list;
Alternate (note: won't work on empty list)
{{libheader|List::Util}}
Line 451:
my $s = sum @list;
Alternate (note: won't work on empty list)
{{libheader|List::Util}}
|