Is it possible to write something in MyWrapper module so that in a code like this:
package Foo;
use MyWrapper;
sub bar { ... }
sub baz { ... }
...
1;
or perhaps this:
package Foo;
use base qw(MyWrapper);
sub bar { ... }
sub baz { ... }
...
1;
I can list all subs in Foo and then wrap them all and then replace them all with Sub::Override? I already find out how to list subs and wrap them, the problem is where to put the code in MyWrapper :-). Of course I can just do this:
package Foo;
use MyWrapper qw(wrap_all);
sub bar { ... }
sub baz { ... }
...
wrap_all();
1;
but it's less magical, less automatic, and "less friendly" to my module users (which, most often, is myself).
In reply to Executing use'd/require'd/base module code *after* use'r/require'r/child is compiled? by dgaramond2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |