Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 meditating upon the Monastery: (7)
As of 2014-10-21 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (95 votes), past polls