Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Crazy hash sorting issue.

by kirbyk (Friar)
on Nov 04, 2005 at 18:15 UTC ( #505821=note: print w/replies, xml ) Need Help??


in reply to Crazy hash sorting issue.

TMTOWTDI, of course, but how about:
foreach my $key (sort { substr($hash{$a}, -2) cmp substr($hash{$b}, -2 +) } keys %hash) { print $key . ' ' . $hash{$key} . "\n"; }
Tested, seems to work.

-- Kirby, WhitePages.com

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2016-09-25 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (467 votes). Check out past polls.