sub clean_up{ my ($dir) = @_; my @files = (); my ($seconds, $min, $hour); my $time = timelocal($seconds, $min, $hour, (localtime)[3,4,5]); find sub { push @files, $File::Find::name; }, $dir; @files = sort @files; foreach my $file (@files){ my ( $mtime ) = (stat($file))[8]; utime(time, $mtime, $file); print "$time\n"; $time -= (60*60*24); unlink $file if ($mtime > $time); }#end foreach loop }#end clean_up