I've been exploring mod_perl lately. I like it but.... I'm getting what seems to me to be some odd behaviour, that I can't make sense of.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.