in reply to use file::find to find files modified in last 5 days
use Modern::Perl; use File::Find::Rule; say join "\n", recent_files( 'c:/data/strawberry-perl/perl/script-chrome', 5 ); sub recent_files { # path-to-search, maximum age in days my $time = time - 86400 * $_[1]; return File::Find::Rule->file()->mtime(">$time")->in( $_[0] ); }
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial Deltronics
|
|---|