in reply to Re^4: SUPER in OOPerl is dumped with $self
in thread SUPER in OOPerl is dumped with $self
Consider the following object model:
Each Person::Child instance has an @parents property which holds one or more Person::Adult objects representing its parents (in the real-world sense), yet Person::Adult is not Person::Child's parent (in the OO sense).Person --- Person::Child \-- Person::Adult
This example also answers the question of how to modify pajout's code to allow the child object to have an arbitrary number of parent objects (change the parent property to an array):
...but this is completely unrelated to multiple inheritance, so I question whether it's likely to tell you what you're actually trying to get at.sub parents { my $self = shift; push @{$self->{parents}}, @_ if @_; return @{$self->{parents}}; }
|
|---|