Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Sorting HoHoA based on Length of Second Key

by Pied (Monk)
on Jul 21, 2005 at 03:19 UTC ( [id://476699]=note: print w/replies, xml ) Need Help??


in reply to Sorting HoHoA based on Length of Second Key

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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://476699]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found