My perl program is throwing some warnings, and I am yet to have any luck searching the Internet for a solution. Is there any way I can rewrite the following code snippet so that no warnings are thrown?
"keys on reference is experimental at...":
foreach my $key ( keys %$api_decoded_result{'query'}->{'pages'} ) {
@words = split / /, $api_decoded_result->{'query'}->{'pages'}{$key}->{'extract'};
}
Yup. This is because of precedence of operator dereferencing. %$api_decoded_result
binds tighter than the {'query'}
.
keys %{$api_decoded_result{'query'}->{'pages'}}
Will do what you want.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.