in reply to Help with JSON Module
G'day James,
I see ++philiprbrenan has solved the Useless use of a constant ... problem.
For the malformed JSON ... problem, it might be better to look at your input JSON rather than what's being output with the error message. Try:
my $code = $tesco->product_search({ searchtext => $pn, extendedinfo => + 'N' }); print $code, "\n"; exit;
You might be able to see the problem by inspection; if not, try running it through the validator you mentioned earlier.
[Aside: I'll just point out that chomp is a safer version of chop. Of course, you might have a perfectly valid reason for choosing chop.]
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with JSON Module
by foggy3657 (Novice) on Sep 08, 2012 at 08:26 UTC | |
by kcott (Archbishop) on Sep 08, 2012 at 08:33 UTC | |
by foggy3657 (Novice) on Sep 08, 2012 at 08:51 UTC | |
by Corion (Patriarch) on Sep 08, 2012 at 09:07 UTC | |
by foggy3657 (Novice) on Sep 08, 2012 at 09:24 UTC | |
|