Help for this page

Select Code to Download


  1. or download this
    @newfiles=@files.map([-s($_),$_]).sort($a->[0]<=>b->[0]).map(pop @$_);
    
  2. or download this
    use strict;
    use warnings;
    ...
       @$ret=reverse @$self;
       wantarray ? @$ret : $ret
    }
    
  3. or download this
    package main;
    my @x=Array->new( qw( bb cccc ddd aaaaa fffff qqq xxx iiiii ) )
    ...
               ->map('pop @$_');
    
    print "@x";
    
  4. or download this
    @sorted_by_size = 
      map  { pop @$_ } 
      sort { $a->[0] <=> $b->[0] } 
      map  { [-s $_ , $_ ] } 
      @files;
    
  5. or download this
    @sorted_by_ext_name_size =
      map  { pop @$_ }
    ...
    
    print join(",\n",@files);
    print join(",\n",@sorted_by_ext_name_size);