How about this error: my $test = 1 / 0;. CGI::Carp tells us:
How about this error:Illegal division by zero at ... line 9.
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.my $array = 1; foreach (%$array) { print } #error: Can't use string ("1") as a HASH ref while "strict refs" in use at ... + line 11.
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)
In reply to (jeffa) Re: CGI::Carp won't send fatalsToBrowser
by jeffa
in thread CGI::Carp won't send fatalsToBrowser
by George_Sherston
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |