Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Undefined value as an ARRAY reference, JSON databy johnfl68 (Scribe) |
on Apr 14, 2015 at 17:35 UTC ( [id://1123429]=perlquestion: print w/replies, xml ) | Need Help?? |
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!
Back to
Seekers of Perl Wisdom
|
|