in your CGI scripts and not in your modules, it should work fine both ways

well, actually, no... at least, not for me. I assumed this as well, but lots of experimentation has shown otherwise. For example, in February, I posted Inconsistent results from CGI::Carp handler, to which no one at all has replied. In my own research (which I haven't yet completed, but am getting close), I find that some/many perl errors inside MODULES are not caught by the CGI::Carp handler when the "use" statement is in the main (non-module) perl code (even within BEGIN blocks). However, if I duplicate the code within the modules, then the perl errors are caught and sent to the browser as expected (or to wherever you redirect).

This is the reason for this current thread. If I didn't have to put the "use carp" stuff in the modules, none of this would be of concern.

...and the problems/confusions just seem to be adding up. For example, where are my $ENV environment variables?


In reply to Re^2: How to conditionally use CGI::Carp? by argv
in thread How to conditionally use CGI::Carp? by argv

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.