in reply to Strange behavior of array in scalar context
First of all, your debugging is flawed. You want to pass arrays and hashes as references to Data::Dumper:
print Dumper \@executions, scalar(@executions);
Second, you are copying the reference into @executions, not the contents. This means that @executions will only ever contain a single element:
my @executions = $jobInfo->{'content'}{'executions'};
What you likely wanted is to copy the array items:
my @executions = $jobInfo->{'content'}{'executions'}->@*; # requires P +erl 5.36+ # Alternatively my @executions = @{ $jobInfo->{'content'}{'executions'} };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Strange behavior of array in scalar context
by Anonymous Monk on Jan 26, 2026 at 11:05 UTC |