Your skill will accomplish what the force of many cannot |
|
PerlMonks |
has-a in Perlby skazat (Chaplain) |
on Apr 18, 2005 at 19:45 UTC ( [id://448994]=perlquestion: print w/replies, xml ) | Need Help?? |
skazat has asked for the wisdom of the Perl Monks concerning the following question: Hello All, I'm trying to figure out a good way to do this in Perl. Let's say I have an OO module, Widget and I have another, Widget::CheckBox. Widget::CheckBox is-a Widget - it inherits many of the things from Widget via the @ISA() array. How do I work with Widget::CheckBox from inside the Widget Object? Do I just make a new instance of Widget::Checkbox within Widget? That sounds sort of wasteful. It seems I should be a ble to pass a reference to my Widget self, directly to Widget::Checkbox and have Widget::Checkbox see if it gets passed something like that. Basically, it would seem I want to do *both* of these things:
Am I making sense? :) I'm guess I'm not clear on working with Perl while using a, "Has A" relationship;
-justin simoni
Back to
Seekers of Perl Wisdom
|
|