in reply to Re: Weird inheritance and SUPER
in thread Weird inheritance and SUPER
Thanks, yes, the change you suggest do eliminate the error. But:
My problem, upon reflection, was that in trying to understand this, I read the following in my trusty Camel:
SUPER...follows @ISA just as the regular inheritance mechanism does: in left-to-right, recursive, depth-first order. (3e, p. 325)
However, I'd failed to read notice the following:
A SUPER method consults the @ISA only of the package into which the call to SUPER was compiled. It does not care about the class of the invocant, nor about the package of the subroutine that was called. (ibid)
I guess I expected that SUPER would follow the invocant's class hierarchy.
As I mentioned in my original post, I solved the problem by renaming Q::bar, but now I'm curious. Is there a way to get the behavior I was looking for, without either changing method names or the class hierarchy? I imagine this would be some magic to replace the SUPER
Thanks.
--roundboy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Weird inheritance and SUPER
by rir (Vicar) on Jan 22, 2003 at 03:44 UTC | |
|
Re: Re: Re: Weird inheritance and SUPER
by pfaut (Priest) on Jan 22, 2003 at 02:51 UTC | |
|
Re: Re: Re: Weird inheritance and SUPER
by dakkar (Hermit) on Jan 23, 2003 at 13:59 UTC | |
by roundboy (Sexton) on Feb 05, 2003 at 03:44 UTC |