Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Re: Re: Sorting by the value of the inner hash

by DamnDirtyApe (Curate)
on Mar 31, 2004 at 08:37 UTC ( #341249=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Sorting by the value of the inner hash
in thread Sorting by the value of the inner hash

Give this a shot:

#! /usr/bin/perl use strict; *OUT = *STDOUT; my %totalscoreinv; $totalscoreinv{700200} = { 523246 => -438.024029240629, 523247 => -470.547762535975, 523237 => -494.393864137596, 523261 => -509.711586526694, 523424 => -521.488541326437 }; foreach my $keyscore (keys %totalscoreinv) { print OUT "\n\nFirst key:$keyscore\n"; foreach my $keyscore2 ( sort {$totalscoreinv{$keyscore}{$b} <=> $totalscoreinv{$keyscore}{$a}} keys %{$totalscoreinv{$keyscore}} ) { printf OUT "%30s %s\n", "$keyscore2= ", $totalscoreinv{$keyscore}{$keyscore2}; } }

_______________
DamnDirtyApe
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
            --Friedrich Nietzsche


Comment on Re: Re: Re: Re: Re: Sorting by the value of the inner hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2015-07-02 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (27 votes), past polls