in reply to Re^6: Not an ARRAY reference
in thread Not an ARRAY reference


The JSON parser I use decodes an entire record at one time, so either the whole JSON record parses correctly or it's rejected. I only showed a text file line-based example because it was easy. If you want to handle a response at a time, it would be essentially the same: Wrap the JSON decode operation in an eval { } block, then check the $@ variable to see if there's an exception after the eval block and choose to process the data or handle the error.


When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^8: Not an ARRAY reference
by chandantul (Beadle) on Nov 13, 2020 at 04:00 UTC

    The issue has been resolved once changed the API call. The issue was with JSON response