See perldoc perlvar for the variable $>, which can be set to 0 to change your effective user to root. However, (and I'm not a sudo expert), I believe this will require that the admins allow you to use Perl as root, which basically means letting you do anything as root, which they don't appear to want to do. I don't know if there's a way to lock Perl down so you can only do things like testing file existence as root, but not things like system('rm -rf /');.
I'd add that if they want you to have read access to some files, there are better ways to do that than giving you sudo to root for certain commands. It'd probably make more sense to set global or group execute permission on the directories in question and read permission on the files, and not involve root access at all. An awful lot of seemingly harmless commands can be dangerous when run as root by someone who knows what he's doing (or doesn't).
Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.
In reply to Re: perl file status and sudo
by aaron_baugher
in thread perl file status and sudo
by Saved
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |