Trying to remove the -w requirement in the perl shebang line

digilexic

Verified User
Joined
Nov 5, 2003
Messages
67
Okay, apparently the script I use as a portal will only work if my shebang line at the beginning of evry .cgi file is:

#!/usr/bin/perl -w

The only problem is that there are like 30 scripts I have to edit each time I update to the latest version.

I have been told that this is because I am running the scripts under my account's username instead of "nobody" What I want to know is how do I keep the server from requiring the -w command in the shebang line? I know the -w causes errors to be written to the log, but I dont need this function to be mandatory.

Seems like out of the few hundred people who use the cgi portal program there is only a handful that require this line on their server to keep the "premature end of script" errors I have seen mentioned before.
 
Hello,

Not sure I can help you with running as nobody, but if you want a quick and easy way to change all the cgi scripts, you could run:
Code:
perl -pi -e 's/^#!\/usr\/bin\/perl$/#!\/usr\/bin\/perl -w/' *.cgi
.. that's untested and some characters might need escaping (put \ in front), but should help speed things up for you.

John
 
Back
Top