To clarify, you are not parsing a JSON response, you are using a Perl data structure returned by the module. There no JSON handling in your code and it’s irrelevant to what you’re doing whether or not Geo::Coder::Google does so under the hood. I also think this is closer to the kind of approach you want than assuming data positions will remain immutable–
my $location = $geocoder->geocode(location => "STRING"); for my $component ( @{ $location->{address_components} } ) { next unless grep $_ eq "country", @{$component->{types}}; print $component->{long_name}, $/; }
In reply to Re: Parsing a JSON response
by Your Mother
in thread Parsing a JSON response
by mcoblentz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |