in reply to Deleting Files

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;

Replies are listed 'Best First'.
Re: Re: Deleting Files
by LeeC79 (Acolyte) on Oct 03, 2003 at 17:36 UTC
    Thanks very much! I guess I was just looking at the stupid code for too long, couldn't see the simple solution!! Thanks again.