Keep It Simple, Stupid | |
PerlMonks |
Re: Re: sorting hash of hashesby larryk (Friar) |
on Apr 25, 2001 at 14:54 UTC ( [id://75410]=note: print w/replies, xml ) | Need Help?? |
++ for you for that answer. I have a question...
I thought I was in the twilight zone earlier when I came to perlmonks to put down a question about sorting multidimensional hashes and the top question here was just that! here's mine...
but since I am all "use strict;"-ed up, Perl moans that $log needs an explicit package name for $log in the for my $line ( keys %{$logdata->{$log}} ) { lines. This is more complicated than anything I have had to do to date and this is where I got stuck. Against my better judgement I tried a foreach my $log (keys %$logdata) { above the two lines mentioned in the last paragraph but the output was not quite what I was looking for (a bunch of empty lines inamongst the UNsorted output). I have a solution - make the first key in %$logdata "$log|$line" and remove a level from the hash but I figure there has to be a way to do this properly. Any help would be much appreciated. larryk
In Section
Seekers of Perl Wisdom
|
|