I have just started using CGI::Application (and am loving it). And my best guess would be to use the AUTOLOAD run mode. I don't know if this is the correct way of solving this, though I think it is.

Quoted from the CGI::Application documentation:

        THE RUN-MODE OF LAST RESORT: "AUTOLOAD"

        If CGI::Application is asked to go to a run-mode which doesn't exist
        it will usually croak() with errors. If this is not your desired
        behavior, it is possible to catch this exception by implementing a
        run-mode with the reserved name "AUTOLOAD":

          $self->run_modes(
                "AUTOLOAD" => \&catch_my_exception
          );

        Before CGI::Application called croak() it will check for the
        existance of a run-mode called "AUTOLOAD". If specified, this
        run-mode will in involked just like a regular run-mode, with one
        exception: It will receive, as an argument, the name of the run-mode
        which involked it:

          sub catch_my_exception {
                my $self = shift;
                my $intended_runmode = shift;

                my $output = "Looking for '$intended_runmode', but found 'AUTOLOAD' instead";
                return $output;
          } 

        This functionality could be used for a simple human-readable error
        screen, or for more sophisticated application behaviors.


In reply to Re: How do I override the error display of a CGI::Application by Anonymous Monk
in thread How do I override the error display of a CGI::Application by Banky

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.