use List::Util 'reduce'; use Algorithm::Loops 'MapCarE'; my $prod= reduce {$a+$b} MapCarE { reduce {$a*$b} @_ } \( @x, @y, @z );