in reply to Re: max value in a hash
in thread max value in a hash
Of course, if you are sure that all values are positive numeric values, there is no problem. But it is something to keep in mind in general, I think.my %hashName = (a => -1, b => -2, c => -3); my $max = 0; $_ > $max and $max = $_ for values %hashName; print $max; __END__ 0 # expected -1
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:^3 max value in a hash
by Hena (Friar) on Jun 01, 2004 at 09:10 UTC |