stat can fail for a number of reasons.
Add the following before the if (-s) line:
use Data::Dumper; print(Dumper(-s "/home/vcg/Documents/Trial/temp")); print(Dumper("$!"));
What's the output?
In reply to Re^5: -s testing for empty file; works on local, but not on remote
by ikegami
in thread -s testing for empty file; works on local, but not on remote
by Jeri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |