Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2016-10-01 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (574 votes). Check out past polls.