Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Overriding CORE::GLOBAL::warn/die

by sundialsvc4 (Abbot)
on Sep 21, 2012 at 18:42 UTC ( [id://994972]=note: print w/replies, xml ) Need Help??


in reply to Overriding CORE::GLOBAL::warn/die

I would not advise overriding any “core” functionality, because of course that would be all-encompassing.

Consider using code such as Exception::Class, which leverages the fact that you can in fact “die” with an object, not merely a text string.

I simply think that it is very inadvisable to make any changes that have “global” ramifications to suit a “app-specific” requirement ... because they expose the entire software (every CPAN module, etc.) to the very considerable side-effects of your change.   If I may opine, “Abandon All Hope, Ye Who Enter Here.”   I’m scrambling away from the very thought of this situation so fast, I don’t even care why it’s not working ...  My spider-sense is going off; my trusty elven sword is glowing bright blue ...

Replies are listed 'Best First'.
Re^2: Overriding CORE::GLOBAL::warn/die
by clueless newbie (Curate) on Sep 22, 2012 at 17:37 UTC
    I’m scrambling away from the very thought of this situation so fast, I don’t even care why it’s not working ... My spider-sense is going off; my trusty elven sword is glowing bright blue ...

    Your senses do not deceive you! Involved is a tie of STDERR, BEGIN/INIT/END blocks, implicit source filtering (of modules used) by means of unshifting a sub onto @INC, the override of core die ... and I can't remember what else. And most of the time it does its job quite nicely. And when it doesn't ... I remove the use statement and debug the normal way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found