Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: sort array

by jwkrahn (Abbot)
on Apr 30, 2012 at 20:00 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://968141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-19 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found