I assume the OP wants it as an extra suid script because it must read a file the main script has no permissions for, and it makes complete sense to keep the suid portions of a script as small as possible. Making the whole thing a module would defeat this purpose.
If I understood this correctly, the solution is very easy:
$password = `getPwd.pl`; chomp $password;
In reply to Re^2: Calling a setuid script in a perl script
by mbethke
in thread Perl Setuid - Oracle Password Hardcoding
by hmadhi
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |