http://www.perlmonks.org?node_id=1037835


in reply to Modifying SelfLoader to save eval() text

Lacking other suggestions, here is something that almost works and that is described below. But now the problem devolves into being able to overwrite or chain after SelfLoader::AUTOLOAD if SelfLoader is use'd.

Alternatively if I could trap, replace, or chain on a use SelfLoader that would work too.

I've written a replacement for SelfLoader called Devel::Trepan::SelfLoader and this can be distributed with Devel::Trepan.

The problem I encounter is that the debugger can be and often is loaded before the program to be debugged. So when the debugged program issues a use SelfLoader any AUTOLOAD or SelfLoader::AUTOLOAD code that I've written gets redefined. It looks like AUTOLOAD isn't chained by default, but instead the last one defined is used.