Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How to compare hash values within the same hash?

by LanX (Chancellor)
on Sep 24, 2013 at 23:53 UTC ( #1055566=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<100> %hash = (
                    key1 => 10,
    ...
      DB<109> grep { $count{$_} == $max } %count
     => 10
    
  2. or download this
      DB<119> %rcount= reverse %count
     => (3, 10, 3, 10)
    ...
    
      DB<121> $rcount{$max}
     => 10
    
  3. or download this
      DB<113> use List::Util qw/max/
    
      DB<114> $max = max values  %count
     => 3
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055566]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2016-06-27 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (345 votes). Check out past polls.