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.
In Section
Seekers of Perl Wisdom