Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Strange behavior of array in scalar context

by Corion (Patriarch)
on Jan 26, 2026 at 10:19 UTC ( [id://11167233]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11167233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2026-05-10 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.