I've banged my head against the wall much before under the same problem. I believe the problem lies in that CGI::Carp is only able to catch $SIG{__DIE__} which can't even be set up until the code compiles.

This doesn't answer why it happens, but we use it in our development all the time. Just simply run your cgi from the commandline. You will get a full listing of errors (usually including the line numbers). In the case of your cgi, you'll get an error saying something like Global symbol "$test" requires explicit package name at - line 9. which is a whole lot more helpful than the error you were getting.

Another useful command is to do perl -c myfile.pl which will tell you if your code will compile.

my @a=qw(random brilliant braindead); print $a[rand(@a)];


In reply to Re: CGI::Carp won't send fatalsToBrowser by Rhandom
in thread CGI::Carp won't send fatalsToBrowser by George_Sherston

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.