I've tried two similar bits of syntax. This first one works:
my $obj = PI::something::ObjectManipulator->new();
$obj->setValue('HELLO');
my $objList = [$object];
This, however, doesn't:
my $objList= [];
foreach my $value (@values) {
my $obj = PI::something::ObjectManipulator->new();
$obj->setValue($value);
push @$objList, $obj;
};
What is the difference between these two way of doing things? Why doesn't the second work? (By not work, it seems to be that $objList is still empty at the end of the code.)
@valuesis not an empty list?