in reply to Re^4: Using SUPER in dynamically generated subs
in thread Using SUPER in dynamically generated subs
Oops! I was thinking of another warning.
It turns out the warning is spurious in this case. We want a class's find_ids to refer to $alias_for as it was when find_ids was compiled, which is to say we want $alias_for not to be "shared".
The warning can be silenced by changing
tosub find_ids {
*find_ids = sub {
Tested.
... my ($class, $alias_for) = @_; my $sub = eval "package $class;" . <<'__EOI__'; *find_ids = sub { my ($class, $params) = @_; do_something_with($alias_for); return $class->SUPER::find_ids($params); } __EOI__ die $@ if $@; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Using SUPER in dynamically generated subs
by clinton (Priest) on Nov 13, 2006 at 19:49 UTC | |
by ikegami (Patriarch) on Nov 13, 2006 at 20:03 UTC |