argv has asked for the wisdom of the Perl Monks concerning the following question:

I have written perl modules that are used by various perl scripts that are invoked as cgi on my site.

I use CGI::Carp in my perl scripts, and if there's an error in the main calling script, output is redirected to a file (and the browser, when debugging) exactly as documented.

However, if there's an error in one of the modules that is imported (via "use"), then the carp interface doesn't seem to work. I can copy the same carp code from the main perl script to the top of each module, and THAT seems to work. But shouldn't that not be necessary? Shouldn't its inclusion at the top of the initially-called script be sufficient?

The doc seems to be silent on this matter.

Replies are listed 'Best First'.
Re: CGI::Carp --where does it go? (bug)
by tye (Sage) on Jan 09, 2005 at 09:30 UTC

    There was a fairly long period during which CGI::Carp was broken such that it failed to catch compile-time errors. Upgrade your CGI::Carp and be sure to use it before you use other modules and it will catch any errors in those other modules.

    - tye        

      Thanks--that's exactly the problem (my Carp package was out of date). New thread starts next...