CGI errors when perl throws a warning

Posted by chargeorge on 2013-05-22 06:14

Hey all,

So this one is pretty weird, and it took me a good couple hours to pin down what was happening. Setups is Perl 5.8.8 on IIS 6.0.

System has been trucking on for about 5 years now, and it's a development enviroment, but our production enviroment has the same setup. After pushing up some code, I noticed everything was dropping CGI errors. Fine, I figured it was an issue with my code, checked my syntax, checked all the places that can cause an error but it seemed fine. To be sure, I rolled back to the last working version.

Nope, still getting the CGI errors. Adding Carp, and I still get nothing. To debug, I tried to to do a print of the headers immediately, and print some hello world/ debug text before any code happens to check if it's a configuration issue. Still nothing.

Here's where it gets weird, after tinkering in IIS settings, I realized that a simple hello world script would run fine, but if my script ran, it would upend everything, even my earlier print $Web->header(); print "hello world".

After trial and error, I got it down to the line in question,

my $Data = $Web->param("page");
my $TestString = "Hello ". $Data

Running from the command line, I get a warning about the string being null for concatanation. So I'm guessing that's part of the issue So, I switched IIS to the PerlexDLL, and boom, the script worked. I tried to modify how perl is called from IIS to include a -X flag, but that causes me to get a page not found error. Calling the script like like that from the command line doesn't seem to effect perl when it's called in IIS.

Any suggestions? I'm not sure how warnings were turned on globally, but that seems to be be the culprit. Any way for Active Perl to ignore them, or how I can turn them off? On dev I can switch over to perlex, but I'm worried about this happening in production where Perlex causes some issues.