Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Replacing warn/die with carp/croak?

by brian_d_foy (Abbot)
on Oct 04, 2007 at 21:07 UTC ( [id://642769]=note: print w/replies, xml ) Need Help??


in reply to Replacing warn/die with carp/croak?

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://642769]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found