http://qs1969.pair.com?node_id=376552


in reply to Re: sorting a complex multidimensional hash
in thread sorting a complex multidimensional hash

Since there has been all the dicussion regarding ST -v- GRT, here's an multi-level GRT version. Runs about twice as fast.

print for map{ substr( $_, 1+index( $_, '|' ) ) } sort map { my $key1 = $_; map { pack 'NA* NA* A1 A*', split( '\.', $key1 ), split( '\.', $_ ), '|', $hash{ $key1 }{ $_ } } keys %{ $hash{ $_ } }; } keys %hash;

Just plug it into the test script above to see it run.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon