in reply to Re^3: Using SUPER in dynamically generated subs
in thread Using SUPER in dynamically generated subs
When I called it like this:
my ($class,$alias_for) = @_; install_sub( $class, 'find_ids', sub { my ($class,$params) = @_; do_something_with($alias_for); # Pass the subname to super, because # this is an anonymous sub my $super = $class->super('find_ids'); return $super->($class,$params); }); ....
... then it works perfectly. And when I benchmarked the overhead of using SUPER, there was only a 1% slowdown.
UPDATE My benchmark was wrong. See Re^6: Using SUPER in dynamically generated subs for correct benchmarks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Using SUPER in dynamically generated subs
by chromatic (Archbishop) on Nov 13, 2006 at 20:47 UTC |