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

Re^2: Sorting Question

by Roy Johnson (Monsignor)
on Oct 04, 2004 at 18:49 UTC ( #396335=note: print w/replies, xml ) Need Help??

in reply to Re: Sorting Question
in thread Sorting Question

Which is just the same as @list = sort @list

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^3: Sorting Question
by geekgrrl (Pilgrim) on Oct 04, 2004 at 18:53 UTC
    although you may want to actually sort alphabetically (ie case-insensitive) instead of ASCIIbetically:
    @list = sort { lc $a cmp lc $b } @list;

      Which is why it's often a good idea to use locale when sorting. Then you don't have to contort yourself so much to get good sorting results.

      Damon Allen Davison

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://396335]
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: (1)
As of 2021-05-09 21:51 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (102 votes). Check out past polls.