Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Having trouble reading in a hash from a referenced array

by dave_the_m (Monsignor)
on Dec 18, 2020 at 09:01 UTC ( [id://11125397]=note: print w/replies, xml ) Need Help??


in reply to Having trouble reading in a hash from a referenced array

AT a guess, you need to replace this:
my @newarray = $narray->{"movie_results"};
with this:
my @newarray = @{$narray->{"movie_results"}};
The first sets $newarray[0] to the same array ref contained in the "movie_results" slot of the hash; the second dereferences that array ref and returns all the elements in that array.

Dave.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found