I'll add my belated $0.02 here ... if you want to grab the 10 most recent files in a directory, try something like:
my $dir=".";
my @files=(map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
map { [ -M $_, $_ ] }
glob("$dir/*"))[0..9];
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 { $b->[0] <=> $a->[0] }
map { [ -M $_, $_ ] }
glob("$dir/*"));
splice (@files,-10);
mr.nick ...