le has asked for the wisdom of the Perl Monks concerning the following question:
I have a big hash of hashes that looks like this:
What would be the most performant way to sort keys %hash on the values of 'this', for example?%hash = ( foo => { this => '...', that => '...', here => '...', there => '...' }, bar => { this => '...', that => '...', here => '...', there => '...' } );
Currently, I do it with
Is there anything faster/better?for (sort { $hash{$a}->{this} <=> $hash{$b}->{this} } keys %hash)
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: sort performance
by Adam (Vicar) on Sep 12, 2000 at 02:16 UTC | |
Re (tilly) 1: sort performance
by tilly (Archbishop) on Sep 12, 2000 at 04:01 UTC | |
by runrig (Abbot) on Sep 12, 2000 at 04:45 UTC | |
by tilly (Archbishop) on Sep 12, 2000 at 05:59 UTC | |
by tye (Sage) on Sep 12, 2000 at 07:00 UTC | |
by tilly (Archbishop) on Sep 12, 2000 at 07:05 UTC | |
by tilly (Archbishop) on Sep 12, 2000 at 07:42 UTC | |
by tye (Sage) on Sep 12, 2000 at 08:01 UTC |
Back to
Seekers of Perl Wisdom