Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Exported subroutine redefine

by tilly (Archbishop)
on Nov 11, 2007 at 03:33 UTC ( [id://650114] : note . print w/replies, xml ) Need Help??


in reply to Re^2: Exported subroutine redefine
in thread Exported subroutine redefine

In the case of Carp specifically there is a far easier way. Use Carp::Heavy. Then redefine Carp::longmess_heavy and Carp::shortmess_heavy.

Otherwise you'd have to walk the symbol table. Just to get you started on that, print out the keys of %main::. All of the keys ending in :: are subtables you can look for. Beware of infinite loops. (For instance %main::main::main:: is the same as %main::.)