Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: Inside-out objects inheriting from hash-based classesby xdg (Monsignor) |
on Dec 07, 2005 at 21:52 UTC ( [id://515056]=note: print w/replies, xml ) | Need Help?? |
But what happens if you need/want to make explicit calls to a super class?
Updated/expanded for clarity Assume that you have a method of the same name in Borg as you do in Foo:
If I want to explicitly call the Borg version of that method, I'd call it as $obj->Borg::comment(). However, that's equivalent to this:
Therefore, if Borg::comment is expecting an object of type Borg and intends to muck with its internal structure directly, this will fail since the real Borg object is hidden in a closure in Foo and keyed to $obj and $obj is just the blessed reference for the inside-out object. Or have I missed something? -xdg Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In Section
Meditations
|
|