Help for this page

Select Code to Download


  1. or download this
    my @sorted_files
      = map {$_->[0]}
        sort {$b->[1] <=> $a->[1] or $a->[0] cmp $b->[0]}
        map {[$_, -s]} @files;
    
  2. or download this
    my @sorted_files = sort {-s $b <=> -s $a or $a cmp $b} @files;
    
  3. or download this
    sorted_files = files.sort_by {|f| [- test(?s, f), f]};