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)
Back to
Seekers of Perl Wisdom