![]() |
|
The stupid question is the question not asked | |
PerlMonks |
Re^2: Trouble finding modules from cronby afoken (Chancellor) |
on Apr 13, 2017 at 04:30 UTC ( #1187820=note: print w/replies, xml ) | Need Help?? |
Drop in an exec to get rid of a needless /bin/sh instance:
And if you have more than one perl, specify which one you want to start. Also do this if you are not sure what $ENV{'PATH'} may contain.
But then again, cbeckley++ is right, perl can do fine without a shell:
Perl does not even mind if you prefix those two lines to an existing script, the shebang (#!) line of the existing script will be parsed as a comment. If you don't want to modify scripts, you can also use a perl script as a wrapper:
(untested) This simple one assumes that script.pl returns a true value. Alternatively, use do $filename, but that needs more code for error handling:
(untested) Generally, if you run a script as root or setuid root, consider adding -T to the shebang line to enable taint mode (see perlsec). Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|