Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-08-20 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls