sub product { my $list = shift; my $prod = 1; $prod *= $_ for @$list; return $prod; }