Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: dictionary sorting

by Trimbach (Curate)
on Mar 13, 2002 at 13:48 UTC ( [id://151372]=note: print w/replies, xml ) Need Help??


in reply to [untitled node, ID 151371]

It IS pretty simple: the "cmp" operator that you've already quoted. Your example is complicated because you spend 2 lines eliminating non-word characters and underscores, but without that it can reduced to:
@temp = sort {lc($a) cmp lc($b)} @temp;
How simple is that? :-D

Gary Blackburn
Trained Killer

Log In?
Username:
Password:

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

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

    No recent polls found