Here is another solution: argmin & argmax. In your case, expensive_func($_) would just be $hashName{$_}.
In reply to Re: Max value by hdb in thread Max value by ameezys