$VAR1->{movie_results}[0]{vote_average} because the value of movie_results is an array of hashes.
$VAR1 = { ... 'movie_results' => [ { ... 'vote_average' => '6.8', ...
see perldsc about nested data structures,
I suppose you can have multiple results for the same query, that's why it's an AoH.
And if you just wanna have the AoH try
my $a_movie_results = $VAR1->{"movie_results"}; as a array_ref
or expanded to a list
my @movie_results = @{$VAR1->{"movie_results"}}; as an array
likewise:
my $h_first_result = $VAR1->{"movie_results"}[0]; as a hash_ref
or expanded to a list
my %first_result = %{ $VAR1->{"movie_results"}[0] }; as a hash
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re: Having trouble reading in a hash from a referenced array
by LanX
in thread Having trouble reading in a hash from a referenced array
by SergioQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |