in reply to Perplexing JSON decoding issue.
Hi Miyako,
I'll take a guess: If your JSON string looks like "[ ... ]", then decode_json should return an array reference, not an array as you seem to want with my @apiJson = decode_json( $apiContent );. Instead, you'll have to dereference that array reference with something like my $apiJson = decode_json( $apiContent ); my $msgID = $apiJson->[0]->{'id'};
Hope this helps,
-- Hauke D
|
|---|