in reply to Calling SUPER in MethodMaker-generated methods
<update> Nevermind. It looks like the eval is just trapping the "Can't locate..." error. Strange that it prints the correct results, then. I'll look into it further when I get back from class tonight.</update>
You'll notice that the error says perl is looking for the method in the CustomMethodMaker class, instead of Bug or FixedBug, like it's supposed to.
The issue is that perl appears to be binding SUPER at the time the anonymous sub is created, to the package in which it was created. I'm really not sure why this is happening, but you can get around it by wrapping the call to the SUPER method in an eval.
# In CustomMethodMaker.pm, line 31 # Was: @parent_slots = $self->$to_execute(); # Now: eval { @parent_slots = $self->$to_execute() };
With this change, the test program outputs the following on my system:
id, type, description date_fixed, repairer
If someone more knowledgeable about the internals of Perl's OO could explain why this is happening, I'm rather curious.
bbfu
Black flowers blossom
Fearless on my breath
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Calling SUPER in MethodMaker-generated methods
by danb (Friar) on Jul 08, 2003 at 20:24 UTC | |
by bbfu (Curate) on Jul 08, 2003 at 22:16 UTC | |
by danb (Friar) on Jul 08, 2003 at 22:39 UTC | |
by bbfu (Curate) on Jul 09, 2003 at 04:02 UTC | |
by danb (Friar) on Jul 09, 2003 at 07:48 UTC | |
| |
by danb (Friar) on Jul 09, 2003 at 06:35 UTC | |
by danb (Friar) on Jul 08, 2003 at 23:03 UTC |