note
ikegami
<p>It doesn't take three screenfulls of code to demonstrate a problem with -s. Furthermore, it appears that you didn't even show the code that fails! I'm just going to offer a couple of general tips.
<p>First, what exactly does <c>-s</c> return. If it's zero, that means it thinks the file exists and that it's empty. But I suspect it's returning undef, in which case <c>$!</c> contains an error message. Is <c>-s</c> returning undef, and it so, what's <c>$!</c>?
<c>
my $size = -s "/home/vcg/Documents/Trial/temp";
die("-s: $!") if !defined($size);
if ($size) {
</c>
<p>A common mistake is to pass paths with trailing spaces or newlines. Or improper escaping of <c>\</c>. Make sure the variable contains what you think it does.
927946
927946