Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: How do I find and delete files based on age?by Anonymous Monk |
on Feb 26, 2007 at 19:32 UTC ( [id://602201]=note: print w/replies, xml ) | Need Help?? |
Look into the File::Glob module to get your file list (perldoc File::Glob).
You can use regular expressions to look for filename matches (perldoc perlre), it'll look something like: if ($filename ~= m/DATE_/) For the date comparison, are you going to use a system date, or is there some sort of naming convention that integrates the date into the file name? If the latter, regular expressions are your friend again.
In Section
Seekers of Perl Wisdom
|
|