Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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


Comment on Re: Crazy hash sorting issue.
Download Code

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 drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2015-07-07 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls