I have simple script:
my $file="/path/to/file";
if ( -f $file ) {
print "DEBUG: file exists\n";
} else {
print "DEBUG: no such file\n";
}
I have mentioned file in place and see printout "file exists" on script execution.
But all changes if I run script using sudo.
Just "sudo ./script" and see another printout - "no such file"!
I don't have an idea why behavior so different for my user account and for root.
What is the matter?