John W. Krahn wrote:
Andrej Kastrin wrote:
Dear all,
Hello,
I'm looking for simple (and fast) solution to extract maximum value from
a hash. I search over the Perl mailing lists, but I didn't find anything
usable.
One way to do it:
my $max;
$max < $_ and $max = $_ for values %hash;
And another way:
my $max;
while ( my ( undef, $value ) = each %hash ) {
$max = $value if $max < $value;
}
John
Thanks for your help, Andrej
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>