I have an array that is a member of an structure:
$self->{myArray} = ["value1", "value2"];
And I'm trying to iterate over it using the following code:
my @myArray = $self->{myArray};
foreach my $foo (@myArray){
#Do something with the using $foo
...
}
The problem is that the 'foreach' loop is executed only once (when I would expect it to excute twice, since @myArray has two elements: "value1" and "value2").
When I check the @myArray array size, I get that its size is 1. What am I doing wrong in this code?