Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: problem parsing json

by davido (Archbishop)
on Sep 29, 2012 at 05:37 UTC ( #996337=note: print w/ replies, xml ) Need Help??


in reply to Re^2: problem parsing json
in thread problem parsing json

Here's what I get when I try to parse the JSON you posted:

$ perl -MJSON::Tiny -MData::Dumper -n0777E '$j=JSON::Tiny->new; $o=$j- +>decode($_); say length $o ? Dumper($o) : $j->error;' diamondsandperl +s.json Malformed JSON: Expected array or object at line 0, offset 0

If you pass malformed JSON, you won't get a desirable result. You're using JSON, so with the JSON you posted, you'll get:

$ perl -MJSON -MData::Dumper -n0777E 'say Dumper( JSON->new->decode($_ +) );' diamondsandperls.json malformed JSON string, neither array, object, number, string or atom, +at character offset 995 (before "],\n "...") at -e line + 1, <> chunk 1.

If that's not the error you're seeing, please post the actual JSON document you're working with. Otherwise, you're not likely to get much useful help.


Dave


Comment on Re^3: problem parsing json
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996337]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-08-22 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (145 votes), past polls