ksricwow has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
We have developed a perl script to monitor the Google Applications stats but my plugin sometimes give an 'malformed JSON string,' when running the script.
[root@clrfmd1 libexec]# ./check_googlestats.pl --service='Google Calen +dar' malformed JSON string, neither array, object, number, string or atom, +at character offset 0 (before "(end of string)") at ./check_googlesta +ts.pl line 23
The plugin doesn't always throw this error and works pretty fine most of the time.
The URL that we are accessing is below
my $content = `curl http://www.google.com/appsstatus/json/en 2>/dev/nu +ll`; $content =~ s/dashboard.jsonp\(//g; $content =~ s/\)\;$//g;
The script is trying to process the response from JSON by decoding the URL.
Does anybody have any idea on this? There appears to somehow the parsing is wrong and I am unable to find the problem. Could somebody please let me know what changes are required to get this going.
Regards,
Sricharan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: JSON Parsing error in perl script
by davido (Cardinal) on Aug 26, 2014 at 04:28 UTC | |
|
Re: JSON Parsing error in perl script
by NetWallah (Canon) on Aug 26, 2014 at 05:09 UTC | |
by tobyink (Canon) on Aug 26, 2014 at 14:15 UTC | |
|
Re: JSON Parsing error in perl script
by Anonymous Monk on Aug 26, 2014 at 02:32 UTC |