Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Sorting - lower to upper

by shemp (Deacon)
on Jul 15, 2004 at 16:32 UTC ( [id://374713]=note: print w/replies, xml ) Need Help??


in reply to Re: Sorting - lower to upper
in thread Sorting - lower to upper

Your comparison is backwards, the OP wants the lowercase first so you need:
foreach ( sort { ord($b) <=> ord($a) } keys %hash ) { print "$_ => $hash{$_}\n" }
Kudos though, much more elegant than the solution i posted!

Replies are listed 'Best First'.
Re^3: Sorting - lower to upper
by Joost (Canon) on Jul 15, 2004 at 16:37 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-25 08:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found