well, as my previous post hypothesized, and you clarified in your reply, the error was indeed CGI::Carp redirecting stderr. The reason I didn't catch it before is still unclear, but it deserves attention because I think it has something to do with the order in which packages are included (via use). I am also curious about the same question I asked before, on whether it's kosher for a package to use CGI::Carp, or if that should always just remain in the main::module.

I use a package that has some utility functions, but I only import the functions themselves. I assumed (naively and stupidly, because I never thoroughly read the doc on this narrower issue) that perl only includes those functions that you request, and leaves everything else alone. Apparently not.

This also raises the problem I've had in other circumstances, where packages include functions from other packages, and if my perl code includes one or more of those packages, certain functions end up getting important more than they need to. Again, I just assume that perl will figure this out and all works fine. The problem I ran into, though, is that sometimes the function reference doesn't work, and I have to switch the order in which I list the "use" lines in the perl code to get it to work.

Sometimes, even that doesn't work, and I'm forced to actually use Package::function() before it actually works.

Clearly, I'm not experienced at writing packages, and while I go off and figure that out, perhaps we can bring resolution to the problem that started all this: is it wrong for a package to include cgi::carp?


In reply to Re^4: no error messages for syntax errors? by argv
in thread no error messages for syntax errors? 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.