Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Is there a way to compare the values of one hash (while looping through the hash) and determine how many times
a value has occurred in the hash? $hash = ( key1 => 10, key2 => 10, key3 => 3, key4 => 5, key5 => 10 ); In the hash, above, there are 3 occurrences of the value 10. I need to do this in order display the value that has the highest frequency. Perhaps, there is a way to loop through the hash to compare the current value to the previous value, then increment a counter variable by 1? Any suggestions? Thanks. In reply to How to compare hash values within the same hash? by phildeman
|
|