in reply to SUPER or NEXT from imported methods
If you don't want to go there, then you'll need to write a function that walks the symbol tree yourself. And you'll need to know inside the function what package it is installed in. This could be done with an import method that looks like:
where super is your function that looks at @ISA, and goes looking to find where ${"$package\::$method"}{CODE} is defined, then calls it.sub import { my $package = shift; my $methodname = shift; my $dest = caller; my $method = sub { return super($package, "blah", @_; }; my $symbol = $dest . '::' . $methodname; { no strict 'refs'; *$symbol = $method; } }
Honestly this is so much work that I really would advise the eval solution here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SUPER or NEXT from imported methods
by jsadusk (Acolyte) on Feb 20, 2009 at 23:24 UTC | |
by tilly (Archbishop) on Feb 21, 2009 at 02:04 UTC | |
by jsadusk (Acolyte) on Feb 21, 2009 at 03:35 UTC |