http://qs321.pair.com?node_id=782958


in reply to Re: File::Find preprocess and sort issues
in thread File::Find preprocess and sort issues

Thanks for the idea, I got the code working,
use File::Find; use File::stat; use Data::Dumper; my @directories = ("/u/files", "/tmp"); my @readfiles; File::Find::find({ preprocess => sub { my @files = map { $_->[1] } sort { $a->[0] <=> $b->[0]} map { [ stat("$_")->ctime, $_] } grep { /\w/ && !/^TA\d{1,8}$/ && !/gz$/} @_; return @files }, wanted => sub {push @readfiles, "$File::Find::dir/$_" +if (-f); } , postprocess => sub { rmdir $File::Find::dir }, }, @directories); print Dumper \@readfiles;