laziness, impatience, and hubris | |
PerlMonks |
Re: Sorting HoHoA based on Length of Second Keyby Pied (Monk) |
on Jul 21, 2005 at 03:19 UTC ( [id://476699]=note: print w/replies, xml ) | Need Help?? |
Here is what I managed to get working: print foreach (sort {(length ((keys %{$HoHoA{$b}})[0])) <=> length((keys %{$HoHoA{$a}})[0]) } keys %HoHoA); It only works if all second keys are the same length (which is the case with your submitted code) Is that what you want? P!
In Section
Seekers of Perl Wisdom
|
|