in reply to Search windows folder for old files...

my $name = $_;

You need to prepend the directory, beacuse readdir only returns the filename and not the complete path to it. Also see the documentation of readdir, which states your use case:

... If you're planning to filetest the return values out of a readdir, you'd better prepend the directory in question. ...

Replies are listed 'Best First'.
Re^2: Search windows folder for old files...
by Wizbiscuit (Initiate) on Mar 13, 2012 at 12:19 UTC

    Ahhh great, yer I see that now, so I guess my . and .. maybe are not in the directory I think they are, something to work on...

    Now to work our how to fix it!! :)

      Unsure if any use, but if somebody comes across this again, the fix was simple, I just had to add...

      chdir $directory or die $!;