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