{ my $lastepch = time; my @files; my @todel; my $counter; sub wanted { $logger->info("Reached $File::Find::name") if ($counter++ % 100) == 0; push @files,$File::Find::name if (/\.*$/ and -f $File::Find::name and stat($File::Find::name)->mtime > $lastepoch); push @todel,$File::Find::name if (-d $File::Find::name); }, $indir; } sub Get_FileList { @files = (); @todel = (); find (\&wanted, $_[0]); $lastepch = time; ... return (\@files, \@todel); } } my ($files, $todel) = Get_FileList($indir);