in reply to Wrong file check while running using sudo

You might get a better error message by trying to open a file:
open my $handle, '<', $file or die $!;

There are configurations where root isn't allowed to view some directories (for example with selinux) where -e would return false. But that's pure speculation on my side.

Replies are listed 'Best First'.
Re^2: Wrong file check while running using sudo
by accessdenied (Acolyte) on Nov 14, 2008 at 14:18 UTC
    I found root cause. In /path/to/file one folder is not readable for others and root is not in the same group as folder owner, so root can't read folder content. So simple but I had broken my brine during two last days.