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
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?