List::Util
use List::Util qw(reduce); my $result = reduce { BLOCK } @list; my $sum = reduce { $a + $b } 1 .. 10 my $min = reduce { $a < $b ? $a : $b } @scores; my $max = reduce { $a > $b ? $a : $b } @scores;
use List::Util qw(reduce); my $result = reduce { BLOCK } @list; my $sum = reduce { $a + $b } 1 .. 10 my $min = reduce { $a < $b ? $a : $b } @scores; my $max = reduce { $a > $b ? $a : $b } @scores;