Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: sorting a hash by keys, according to preference

by dave0 (Friar)
on Apr 13, 2005 at 04:02 UTC ( [id://447256]=note: print w/replies, xml ) Need Help??


in reply to sorting a hash by keys, according to preference

If you know all of the keys you want to reference, and the order you'd like them in, why not just avoid the sort in the first place?
for my $point ( @{$aoh} ) { for my $type ( qw ( start stop step ) ) { print "$type = " . $point->{$type} . "\t"; } print "\n"; }

Replies are listed 'Best First'.
Re^2: sorting a hash by keys, according to preference
by vindaloo (Acolyte) on Apr 13, 2005 at 04:12 UTC
    Thanks for the pointers! I was sure it had to be more simple than a Shwartzian Transform...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2025-06-16 23:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.