![]() |
|
Do you know where your variables are? | |
PerlMonks |
Can I get a -S switch that doesn't care about the execute bit?by DrWhy (Chaplain) |
on Aug 22, 2011 at 23:29 UTC ( [id://921765]=perlquestion: print w/replies, xml ) | Need Help?? |
DrWhy has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on an application system that depends on being able to run scripts where you don't necessarily know exactly where they are. I'd really like to make is so you can just:
without necessarily knowing ahead of time which directory the script is in. By setting the PATH variable appropriately and putting '-S' in PERL5OPT I can almost get there. The fly in the ointment is that the scripts that can be found and run this way must have the execute bit set on them. Our system doesn't typically set the execute bits on the perl scripts that are a part of it, and I'd rather not introduce this requirement to the existing system. So I'm seeking the wisdom of the monastery on this. Does anyone know of a way to accomplish this 'script name resolution' capability for scripts that don't have the execute bit set? NB: perl -S script_not_executable.pl will find the script, but will then complain that script_not_executable.pl is not executable. Set the execute bit and it works. --DrWhy "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
Back to
Seekers of Perl Wisdom
|
|