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