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:
use Widget; my $w = new Widget; return $w->widgets->checkbox; # --- or -- use Widget::Checkbox; my $wc = Widget::Checkbox; print $wc->checkbox;
Am I making sense? :)
I'm guess I'm not clear on working with Perl while using a, "Has A" relationship;
-justin simoni
skazat me
In reply to has-a in Perl by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |