Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

( #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 chanting in the Monastery: (11)
As of 2015-07-06 06:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls