Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by perlfan (Vicar)
on Dec 18, 2020 at 17:31 UTC ( #11125417=note: print w/replies, xml ) Need Help??


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

You're getting a hash reference, so something like the following would make it more natural for you:
my $results_href = $search->find( id => 'tt0114694', source => 'imdb_id' ); my $movies_aref = $results_ref->{movie_results}; printf(qq{~~~~%d M O V I E R E S U L T S~~~~\n}, scalar @{$movies_ar +ef}) if @{$movies_aref}; foreach my $movie_href (@{$movies_aref}) { $title = $movie_href->{title}; $summary = $movie_href->{summary}; print qq{ Title: $title Summary: $summary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }; } print qq{~~~~N O M O V I E R E S U L T S :( :(~~~~\n} if @{$movies_a +ref};

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2021-04-17 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?