This particular bug report looks like more Perl Best Practices fanboyism where the reporter doesn't understand what's actually going on in the code. It's clear from his response that he doesn't understand why you shouldn't change it, just that no one should ever, ever use die. There's no associated programming problem here (or that he has reported).

Most of the calls to die in DBM::Deep are for code that happens very early (as in _init) and usually around an eval where some special magic is happening. That's internals stuff that no user should be thinking about.

DBM::Deep does its error handling with _throw_error, which already handles what Carp does (mostly). I know because I sent Rob the patch to make that happen. The complaint that DBM::Deep is not going to show its exceptions from the perspective of the caller is just ignorant. It does that already because I made something better: _throw_error shows the file and line number from the first thing that isn't inside DBM::Deep. Since something inside DBM::Deep is calling _throw_error, croak would report a line number inside DBM::Deep still. Replacing that with croak would be a step backwards, and it would break some of my code when croak starts reporting the wrong thing. If there's a bug in _throw_error, report that with an example script that shows the bug.

I say close the ticket and ignore it. RT does have a "reject" option. :)

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

In reply to Re: Replacing warn/die with carp/croak? by brian_d_foy
in thread Replacing warn/die with carp/croak? by dragonchild

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.