Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

short sorts

by Lady_Aleena (Priest)
on Mar 28, 2012 at 05:52 UTC ( [id://962078]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub short_sorts {
      my ($a,$b,$type) = @_;
    ...
      my $random_sort = (keys %sorts)[rand (keys %sorts)];
      return $sorts{$random_sort}->($a,$b) if !$type;
    }
    
  2. or download this
    my @unsorted_array = qw(red yellow green cyan blue magenta);
    
    my @sorted_array = sort { short_sorts($a,$b,'ci-d-r") } @unsorted_arra
    +y;
    
    print "$_\n" for @sorted_array;
    
  3. or download this
    yellow
    green
    ...
    blue
    red
    magenta
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://962078]
Approved by GrandFather
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-18 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found