in reply to Re: Comparing Dates
in thread Comparing Dates

I think the original poster's code only gets files within the directory, not subdirectories. If the subdirectories are needed, then you could do a recursive solution, like -
use File::Find; @ARGV = ('.') unless @ARGV; #start at . unless given # as command line argument sub ProcessFiles { &CheckAndFixFile($File::Find::name); } find(\&ProcessFiles, @ARGV); # find is recursive sub CheckAndFixFile { my $filename = shift @_; #Put code here to check if $filename meets criteria, and delete li +ne if needed. }

The CheckAndFixFile subroutine is where you would use Date::Manip, or whichever Date module you like, to compare dates. It's easier than writing your own regular expression, as you did in your post, and it's code that's been tested and works.