dgaramond2 has asked for the wisdom of the Perl Monks concerning the following question:
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Executing use'd/require'd/base module code *after* use'r/require'r/child is compiled?
by jettero (Monsignor) on Feb 28, 2009 at 12:26 UTC | |
|
Re: Executing use'd/require'd/base module code *after* use'r/require'r/child is compiled?
by phaylon (Curate) on Mar 01, 2009 at 19:57 UTC | |
|
Re: Executing use'd/require'd/base module code *after* use'r/require'r/child is compiled?
by dgaramond2 (Monk) on Mar 04, 2009 at 12:33 UTC |