On Mon, Jan 07, 2008 at 04:19:17PM +0000, David Cantrell wrote: > On Sat, Jan 05, 2008 at 10:24:47PM +0000, Nicholas Clark wrote: > > > Not tested, but, can you > > > > 1: grab the address of print's op from PL_ppaddr > > 2: store it somewhere useful > > 3: replace it in PL_ppaddr with your own function > > > > Your own function calls the original, and then before returning, checks > > the return value on the stack. If it indicates fatal, then check the calling > > context. If that's void, croak. > > > > Otherwise return normally. > > Please for the love of god don't do that. Global changes to perl's
But I can for the love of Mammon? :-) [ http://www.miltonbrewery.co.uk/beers/mammon.html Not that I had any last night, because Christmas was still in bottled form: http://www.individualpubs.co.uk/pembury/drinks.html ] > behaviour propagating out of some obscure module several steps away in > your application's dependency tree are a Bad Idea. See UNIVERSAL::* for > examples of why. Good point. I think that it's already been suggested that it can be done lexically in 5.10 (and later) by inspecting $^H, and only croaking if it's void context and and a user defined lexical pragma has enabled it. Nicholas Clark