I think that people are solving the wrong problem.

If I am not mistaken, your issue is that you are dying in the module, and this information does not tell you where in your program the problem is. The right solution to this is to change the module to use Carp's croak or confess function rather than dying. The croak function will try to figure out where in your script the fatal call came from. The confess function will give a complete stack backtrace, which will include both the line in the module and the line in the script.

If you don't want to change the module, a quick hack to make dies confess instead looks like this:

use CGI::Carp; use Carp; BEGIN { $CGI::Carp::WRAP++; $SIG{__DIE__} = \&CGI::Carp::confess; }
(The output may look very awkward if the die came from a carp or confess.)

Random note. While fatalsToBrowser is great for development, you should disable it before going to production. Else it makes any security hole much worse by providing useful information for attackers to use to "debug" their attacks on bugs in your software.


In reply to Re: Disabling CGI::Carp(fatalsToBrowser) by tilly
in thread Disabling CGI::Carp(fatalsToBrowser) by Spidy

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.