Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: File::Find preprocess and sort issues (solved)

by chanakya (Friar)
on Jul 24, 2009 at 12:50 UTC ( [id://782958]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://782958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found