Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 (Novice) 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 chilling in the Monastery: (5)
As of 2024-03-29 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found