in reply to find "x" quantity newest files in a dir
Then you can simply do whatever operation you want on @files. If you want all the files EXCEPT the newest ten, you can invert the sort logic and play with splice ala:my $dir="."; my @files=(map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [ -M $_, $_ ] } glob("$dir/*"))[0..9];
my $dir="."; my @files=(map { $_->[1] } sort { $b->[0] <=> $a->[0] } map { [ -M $_, $_ ] } glob("$dir/*")); splice (@files,-10);
mr.nick ...
|
---|