- or download this
my $least = min(keys %hash);
my $largest = max(keys %hash);
- or download this
sub max {
my $max = shift;
$max = ($max < $_) ? $_ : $max foreach @_;
return $max;
}
- or download this
sub reduce (&@) {
my $op = shift;
...
}
$A;
}
- or download this
sub max {
reduce {$a > $b ? $a : $b } @_;
}
- or download this
sub sum {
reduce {$a + $b} @_;
}