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;

Replies are listed 'Best First'.
Re^3: File::Find preprocess and sort issues (solved)
by Anonymous Monk on Jul 24, 2009 at 12:56 UTC
    Correction sir, I got it working with the code I gave you. Sure it contained ideas, but I gave you working code :D