in reply to Recursive Subdirectories

Certainly File::Find can help you out.
#!/usr/bin/perl -w use strict; use File::Find; my @qualifiers = (); my $today = time; my $ten_days = ( 60 # seconds in a minute * 60 # minutes in an hour * 24 # hours in a day * 10 ); # the number of days sub process_file { push @qualifiers, $File::Find::name if is_ten_days_old(); } sub is_ten_days_old { # File::Find has done the following for you: # - chdir to the directory where this file resides # - set $_ to the basename of the file # - set $File::Find::name to the fully-qualified name of the file # Don't check ages on directories. return 0 if -d; # stats $_; ninth item is modification date my $age = (stat(_))[9]; # returns true if old enough, false if not return $today - $age > $ten_days; } find(\&process_file, @ARGV); # Print all the files qualifying: foreach (@qualifiers) { print $_,"\n"; }
Then invoke it like this:
C:> perld tendays.pl C:\this\directory\please
(I think the invocation is right; I 'm a Mac and Unix guy, not Windows. I've run this code on OS X and it works OK there, modulo the file specification syntax being different.) The key is the is_ten_days_old() sub, which tells process_file() which files to keep.

I highly recommend the Perl Cookbook; if you don't have a copy, you should consider getting one. This is a modification of Recipe 9.7, Processing All Files in a Directory Recursively.

You could do it yourself, but File::Find is faster for you to get the job done.