Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: min and max in a hash of hash

by ikegami (Pope)
on Jul 12, 2010 at 22:28 UTC ( #849122=note: print w/ replies, xml ) Need Help??


in reply to Re^2: min and max in a hash of hash
in thread min and max in a hash of hash

That will give you the minimum value for each year. The OP wanted just the overall minimum. If he doesn't need the y/m of the minimum, then he could use

use List::Util qw( min max ); my $min = min map { min values %{$Year{$_}} } keys %Year; my $max = max map { max values %{$Year{$_}} } keys %Year;

Update: Fixed s/values/keys/ as per reply.


Comment on Re^3: min and max in a hash of hash
Download Code
Re^4: min and max in a hash of hash
by pRaNaV (Novice) on Jan 22, 2012 at 12:02 UTC

    hi, slight correction

    use List::Util qw( min max ); my $min = min map { min values %{$Year{$_}} } keys %Year; my $max = max map { max values %{$Year{$_}} } keys %Year;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-07-10 01:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (198 votes), past polls