in reply to CGI::Carp won't send fatalsToBrowser

The one thing i really learned from my compiler class in college was that one should always be thankful of any error message one receives from the compiler (interpreter). Sometimes you just can't get an exact error message. Sometimes you just have to remind yourself that an error message is just a clue, and you have to play detective.

How about this error: my $test = 1 / 0;. CGI::Carp tells us:

Illegal division by zero at ... line 9.
How about this error:
my $array = 1; foreach (%$array) { print } #error: Can't use string ("1") as a HASH ref while "strict refs" in use at ... + line 11.
Notice how in both of those errors, we were never informed of which variables were the culprits? That's because revealing such info to the user is a security hazard.

However, why it won't tell us the line that the error occured on for an undeclared variable, I don't know. I would think that since the other two examples informed us of which line to look at, your error should to. My guess as to why is because the name of the variable is included in the error message that tells the line number.

The solution - always use the error log. And if you can't access the error log - comment out 'use CGI::Carp' and run perl -c on your cgi script. Note that this won't inform us of the 'HASH ref while "strict refs"' error from my second example - to catch run-time errors, run your cgi script on the command line. TIMTOWTDI!

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
F--F--F--F--F--F--F--F--
(the triplet paradiddle)