Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Answer: How I do I sort a list of strings?

by Mago (Parson)
on Jul 09, 2003 at 18:58 UTC ( #272790=categorized answer: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sort SUBNAME LIST
    sort BLOCK LIST
    sort LIST
    
  2. or download this
        # sort lexically
        @articles = sort @files;
    ...
        use sort '_mergesort';  # note discouraging _
        @new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old;   
     
    
  3. or download this
        @articles = sort {$b <=> $a} @files;   
     
    
  4. or download this
        @articles = sort {$FooPack::b <=> $FooPack::a} @files;   
     
    

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[Corion]: The code is 00000000, as always, no?
[GotToBTru]: I remember hearing about somebody misplacing a list of code phrases or something
[marto]: 12345
[GotToBTru]: the "nuclear codes" are in the case cuffed to the wrist of some guy
[LanX]: not always
[LanX]: it's up to the Supreme commander

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-01-20 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.