Enforcing perl warnings and taint mode
Sep. 26th, 2012 05:02 pmI was getting an unexplained, unlogged 500 internal server error response for a perl Hello World script.
#!/usr/bin/perl print "Content-type: text/html\n\n<p>Hello World</p>\n";
This was especially odd because I have a perl program running elsewhere on the same server. After comparing .htaccess settings and triple-checking my Content-type syntax, I found the apparent cause: the server requires either the -w (warnings) or the -T (taint checks) flag be turned on.
I was unable to determine which setting causes this. mod_perl's PerlSwitches can force all scripts to be run with -wT turned on, but I could find no setting to refuse to run scripts which lack either flag.
For a description of taint mode, read perlsec.
.