CGI::Carp's fatalsToBrowsers catches die. So it won't catch things that don't die nor things that die before it gets control (I think newer versions also catch warn and perhaps some other things, check the documentation source code for your version of the module for more details -- at least the documentation I noticed was quite vague).

The second case is the easiest to categorize. If you have the statement use CGI::Carp 'fatalsToBrowser'; in your script, then CGI::Carp gets control as soon as that statement is done compiling. So compile-time errors in that statement or prior to it will not be caught. For example, #!/usr/bin/perl -wT might cause a "too late for -T" error that would not be caught. Not having CGI::Carp properly installed could also cause problems.

There are a few ways to cause a server error without dieing so that they won't be caught. The following are some likely examples. Whether they actually cause a server error in spite of fatalsToBrowser may depend on the version of CGI::Carp you are using and on your web server configuration:

What can go wrong before Perl gets control depends on your web server configuration. You could have a bad #! line (including having \r\n on the end when just \n was expected).

(updated)

                - tye

In reply to Re: When Does FatalsToBrowser Not Send Fatals To Browser? (not die) by tye
in thread When Does FatalsToBrowser Not Send Fatals To Browser? by Cody Pendant

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.