Hi, friends. So we use "croak" all the time. We have some code though that does some dynamic dispatching, and the "croak" shortmess (only showing the caller origin) is inadequate. All we see is the error happening in the "dispatch" routine, but we really need to see where it was dispatched *to*. Of course, just using "die" in this situation work fine; it shows the actual location of the croak. But we since we use "croak" so often, we screw it up sometimes and use croak rather than die. So my question is: is there a way to coax Carp::croak into showing *both* the caller and the callee of the croak call? Another alternative is to use $Carp::Verbose, so we get a full backtrace -- that does indeed work too. Just that it also generates a huge callstack that we'd rather not see on every exception. If Carp::croak cannot be convinced to do this, any suggestions? Maybe write our own "croak" routine that uses Carp's shortmess()?

In reply to Getting croak to show both caller and callee? by Anonymous Monk

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.