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:
perl scriptname.pl arg1 agr2 ... argn
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?
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.
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."