If I uncomment out the die marked with #NOTE1 (and restart the server) I get the standard 500 error not the die message I would expect ('UGGGGH!', this mesg. does show up in the logs however.)
If I re-comment the die, I get the 'huh' I expect (no need to restart the server).
I don't understand this behaviour.
Question 1 What do I have to do to get CGI::Carp (fatalsToBrowser) to work under mod_perl? This code works as I expect when not under mod_perl.
If I uncomment the error_mode liine I get what I expect in the browser ('Oops and $@'), but not the Carp msg.
Question 2 Why and when do I have to restart the server?
Apache/2.0.52 (Unix) mod_perl/1.999.21 Perl/v5.8.0
#! /usr/bin/perl -w + package Comcoa; use base 'CGI::Application'; use CGI::Carp qw(fatalsToBrowser); use strict; + sub setup { my $self = shift; $self->start_mode('start'); #$self->error_mode('error'); $self->run_modes( 'start' => 'start', 'test' => 'test'); } + sub test { die 'ARRRGH!'; } + sub start { #die 'UGGGGH!'; #NOTE1 'huh'; } + sub error { "Oops we have an error?<p>$@"; } + 1;
In reply to CGI::Application & mod_perl by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |