Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: alphabetize a hash ignoring upper/lower cases

by Anonymous Monk
on May 11, 2003 at 11:59 UTC ( [id://257221]=note: print w/replies, xml ) Need Help??


in reply to Re: alphabetize a hash ignoring upper/lower cases
in thread alphabetize a hash ignoring upper/lower cases

if you have a lot of elements doing the case conversion everytime you compare two elements this will be inefficent. i'd suggest:
my @imps = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map { [ lc $_, $_ ] } values %mips;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-24 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found