johnfl68 has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am reading data from JSON, from an external API source.
On some occasions, one of the Arrays in the JSON is not present, because there is no applicable data. This causes the Undefined value as an ARRAY reference error.
I've been looking around for a while for a way to get some working solution out of the error, so I know to just not process that data. But every post I have read makes the assumption that the data is flawed because the array I am looking for should always be there, which isn't the case.
It's like a catch 22, I need to read it to check and see if it is defined, but I can't read it because it is undefined.
Can anyone please point me in the right direction to handle this error? I am sure it is something simple that is just escaping me.
Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Undefined value as an ARRAY reference, JSON data
by afoken (Chancellor) on Apr 14, 2015 at 18:06 UTC | |
by johnfl68 (Scribe) on Apr 16, 2015 at 21:26 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |