in reply to Re^2: Complex Objects
in thread Complex Objects
What I don't see how to do is create a Y1 object. that contains a X1 and an Array of X2 objects.
Weak containment with pointers/references is the standard practice, using scalars for single objects and arrayrefs for multiple objects. Roughly for instance:
package Y1; sub new { ... $self->{X1} = X1->new(); $self->{MANY_X2} = [ X2->new(), X2->new() ]; ... } package main; my $obj = Y1->new(); print $obj->{X1}->{X1prop}; print $obj->{MANY_X2}->[1]->{X2prop};
--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
|
|---|