Think about Loose Coupling | |
PerlMonks |
Re: Multiple inheritance with multiple contructors?by adrianh (Chancellor) |
on Aug 09, 2002 at 22:07 UTC ( [id://189068]=note: print w/replies, xml ) | Need Help?? |
If you really want to do this, here's one way. You just need to suck out the contents of your prototype hash and use it in the newly constructed object. For example:
However, I would guess what you actually need is some sort of object delegation. Is your Subclass actually "kind of" PClass1 object and a "kind of" PClass2 object? Or does it just use them? If the latter, then you might want to take a look at Class::Delegation, Class::Facade and the section on Aggregation in perltoot. I think it was Bertrand Meyer who said something like "You have to be careful with multiple inheritence, otherwise you get a car-owner with four wheels". :-)
In Section
Seekers of Perl Wisdom
|
|