Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Small examples of string eval

by brian_d_foy (Abbot)
on May 14, 2006 at 17:06 UTC ( #549339=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub sortsub {
        $a cmp $b ||
        other_function( $a, $b ) ||
        ...
        }
    
  2. or download this
    sub sortsub {
        string_compare( $a, $b ) ||
        other_function( $a, $b ) ||
        ...
        }
    
  3. or download this
    sub sortsub {
        my @subs = @_;
    ...
            return $result if $result;
            }
        }
    
  4. or download this
    sub make_sort_sub {
        my @subs = @_;
    ...
                }
            };
        }
    
  5. or download this
    my $sort_sub = make_sort_sub( @sub_references );
    
    my @sorted = sort { $sort_sub->() } @stuff;
    
  6. or download this
    #!/usr/bin/perl
    # pre-defined common sort subroutines
    ...
        sort { $sort_sub->() } qw( Fred fred FReD Barney barney Betty BETT
    +Y );
    print "@sorted\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://549339]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-04 14:08 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 (60 votes), past polls