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 ( #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
Node Status?
node history
Node Type: note [id://447256]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-12-04 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (62 votes). Check out past polls.

    Notices?