"If you absolutely want to have the errors go to the web browser, you could probably modify the BEGIN block to print the proper header and use STDOUT instead of a regular file. I haven't tested that though."
In the past (when I didn't have access to the error log file), I used the following to get errors to print to the browser. I can in no way claim credit for the snippet below, but humbly offer it in the spirit that what once helped me may help you.
Hagbone#Put the following code at the top of the script, just below #!/usr/bi +n/perl. #Run the program from your browser, and tell us what is printed there. BEGIN { local($|) = 1; # Temporarily turn off bufferi +ng print "Content-type: text/plain\n\n"; my $date = localtime; print "Script $0\nrunning on $date (Perl version $])\n\n"; unless (open STDERR, ">&STDOUT") { print "Can't redirect STDERR: $!"; exit; } print "\n"; }
In reply to Re: CGI::Carp failing to report errors
by Hagbone
in thread CGI::Carp failing to report errors
by oghran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |