Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Script to find and delete files

by eff_i_g (Curate)
on Mar 03, 2011 at 19:46 UTC ( #891293=note: print w/ replies, xml ) Need Help??


in reply to Script to find and delete files

I would do something like this:

use warnings; use strict; use DateTime; use File::Find::Rule; my $time_zone = DateTime::TimeZone->new(name => 'local'); my $a_year_ago = DateTime->now(time_zone => $time_zone)->subtract(year +s => 1); File::Find::Rule->file ->name(qr/\A\d{7}_\d-\d{7}-\d{2}_\d{10}\.para\z/) ->mtime('<' . $a_year_ago->epoch) ->exec( sub { ### Your logic. } )->in(qw( /paths /to /search ));


Comment on Re: Script to find and delete files
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (17)
As of 2015-07-02 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (37 votes), past polls