my $least = min(keys %hash); my $largest = max(keys %hash); #### sub max { my $max = shift; $max = ($max < $_) ? $_ : $max foreach @_; return $max; } #### sub reduce (&@) { my $op = shift; no strict 'refs'; my $pkg = caller; local *A = local *{"$pkg\::a"}; $A = shift; local *B = local *{"$pkg\::b"}; foreach $B (@_) { $A = $op->(); } $A; } #### sub max { reduce {$a > $b ? $a : $b } @_; } #### sub sum { reduce {$a + $b} @_; }