in reply to Re: Re5: Calling SUPER in MethodMaker-generated methods
in thread Calling SUPER in MethodMaker-generated methods
Would you accept a small tip via PayPal
Nah, don't sweat it. I enjoyed helping. :) I appreciate the offer, tho.
Update: Re: your code; I just wanted to point out that you should probably either put the assignment to @parent_slots inside the eval, since it's conceivable that the super-method could correctly return an empty list which would cause your code to die, or make the test for dying an explicit check on $@ (in which case the 1; at the end of the eval is superfluous). IOW, it's best to do this:
@parent_slots = eval "package $class; \$self->SUPER::$method_name()"; die $@ if $@;
Also, if you're going to pass @_ in to the super-method, you need to shift $self off first, instead of setting it via list-context assignment. (Otherwise, the super-method gets two copies of $self.)
bbfu
Black flowers blossom
Fearless on my breath
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re7: Calling SUPER in MethodMaker-generated methods
by danb (Friar) on Jul 09, 2003 at 17:42 UTC | |
by bbfu (Curate) on Jul 13, 2003 at 18:46 UTC |