http://qs321.pair.com?node_id=11123508


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

chandantul:

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.

...roboticus

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