readdir returns file names without directory paths. You're probably not in C:/dir, so you need to give your files absolute paths or change to that directory.
use File::Spec; my @files = map { File::Spec->catfile( 'c:/dir', $_ ) } grep { ... } readdir DIR;
In reply to Re: Deleting Files
by chromatic
in thread Deleting Files
by LeeC79
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |