Early in your loop, you should probably update that to the full path :
ALso - Why are you using the strange "${\File::Spec...}" syntax ?$file = File::Spec->catfile($dir, $file);
All power corrupts, but we need electricity.
In reply to Re: -s file test operator only works in same directory
by NetWallah
in thread -s file test operator only works in same directory
by Bowlslaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |