Re: oop array question

2011-09-03 Thread Rob Dixon
On 03/09/2011 12:22, Ron Weidner wrote: I'm trying to add a object to an array of objects. The code below is wrong. sub add_widget { my $self = shift; my $new_widget = shift; push ( @($self->{WIDGETS}), $new_widget ); } Hi Ron You probably want push @{$self->{WIDGETS}}, $n

oop array question

2011-09-03 Thread Ron Weidner
I'm trying to add a object to an array of objects.  The code below is wrong. sub add_widget {     my $self = shift;     my $new_widget = shift;     push ( @($self->{WIDGETS}), $new_widget ); } Later, I'm going to need to iterate over the array of widgets.  How can I accomplish these 2 tasks?