in reply to Re^2: perl file status and sudo
in thread perl file status and sudo

I'm confused. Are you saying you can do if [ -f file ] in the shell, but not if (-f "file") from a Perl program?

Replies are listed 'Best First'.
Re^4: perl file status and sudo
by Saved (Beadle) on Mar 22, 2012 at 13:33 UTC

    -f or -e work fine in my perl as me, but I need to ascertain the existence of files I do not have standard *NX access to, so I need something like sudo.

      If you need sudo, then use sudo.

      I don't see a technical problem that needs to be solved.

Re^4: perl file status and sudo
by Saved (Beadle) on Mar 22, 2012 at 13:56 UTC

    The issue is, I have been told by in-house staff that is is not possible in sudo. I though someone might know if it is, or if there is an alternate.

      *What* isn't possible in sudo?

        Giving perl -e $FILE or -f $FILE the ability to return the correct status of files that I, as a standard user do not have access to. As Security, I am allowed to see anything, but change nothing, and so as my standard user, am told files do not exist that really do.