Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: sort array

by jwkrahn (Monsignor)
on Apr 30, 2012 at 20:00 UTC ( #968141=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub _on_left {
        my ( $s ) = @_;
    ...
        my $word_level=3;
        return  $words[ scalar( @words ) - $word_level ];
    }
    
  2. or download this
    sub _on_left {
        my ( $s ) = @_;
    ...
        my $word_level = 3;
        return  $words[ $word_level - 1 ];
    }
    
  3. or download this
    sub order_line{  
        my @sorted_lines;
    ...
        return lc( _on_left(  $a )) cmp lc( _on_left( $b )); 
        
    }
    
  4. or download this
    sub order_line{  
        my @sorted_lines = sort { _by_left( $a, $b ) } @lines;
        print @sorted_lines;
    }
    
  5. or download this
    sub order_line{  
        my @sorted_lines = sort _by_left @lines;
    ...
        return lc( _on_left(  $a )) cmp lc( _on_left( $b )); 
        
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968141]
help
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: (9)
As of 2015-07-29 10:05 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 (263 votes), past polls