Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Application & mod_perl
by dragonchild (Archbishop) on Feb 01, 2005 at 01:33 UTC | |
|
Re: CGI::Application & mod_perl
by perrin (Chancellor) on Feb 01, 2005 at 03:40 UTC | |
by hsinclai (Deacon) on Feb 01, 2005 at 16:22 UTC | |
|
Re: CGI::Application & mod_perl
by hsinclai (Deacon) on Feb 01, 2005 at 01:51 UTC | |
by perrin (Chancellor) on Feb 01, 2005 at 03:06 UTC | |
by hsinclai (Deacon) on Feb 01, 2005 at 03:30 UTC | |
by CountZero (Bishop) on Feb 01, 2005 at 06:53 UTC | |
by Anonymous Monk on Feb 01, 2005 at 17:49 UTC | |
|
Re: CGI::Application & mod_perl
by CountZero (Bishop) on Feb 01, 2005 at 07:09 UTC |