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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: sorting a complex multidimensional hash
by wfsp (Abbot) on Jul 22, 2004 at 16:58 UTC | |
by BrowserUk (Patriarch) on Jul 22, 2004 at 17:09 UTC | |
Re^3: sorting a complex multidimensional hash
by envirodug (Novice) on Jul 22, 2004 at 19:29 UTC | |
by BrowserUk (Patriarch) on Jul 22, 2004 at 20:47 UTC |
In Section
Seekers of Perl Wisdom