$file =~ /BOT/ will never succeed because readdir returns the leaf name, not the whole path so you get BOT rather than /www/htdocs/reports/bot/.
For something like this I'd be inclined to use File::Find in any case.
In reply to Re: Finding Oldest File in a Directory
by GrandFather
in thread Finding Oldest File in a Directory
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |