Because using File::File::name gets you a file name including the path so that -M or stat can find the file. If you don't want to recurse into directories use:
if (-d Find::File:name) { File::Find::prune = 1; return; }
In reply to Re^3: Finding Oldest File in a Directory
by GrandFather
in thread Finding Oldest File in a Directory
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |