Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: json return value

by stenasc (Novice)
on Jul 12, 2013 at 10:18 UTC ( [id://1043937]=note: print w/replies, xml ) Need Help??


in reply to Re^2: json return value
in thread json return value

Hi, Thanks to all that replied. Just found out that the web hosts cannot install json as the website is on a shared server. However JSON::PP looks to be installed. I'm unsure of the changes that need to be made in the server and client code to ensure it works with JSON::PP. Any help greatly appreciated.

Replies are listed 'Best First'.
Re^4: json return value
by marto (Cardinal) on Jul 12, 2013 at 10:34 UTC

    Replace:

    use JSON;

    with

    use JSON::PP;

    Then test your code. As of v2 JSON determines if JSON::XS is installed, and falls back to using JSON::PP if the XS version isn't available. Perhaps you have an old version of JSON installed. You could also use local::lib to install modules to a directory under your control, and load them from there.

      First thing I did. It made no difference. It looks as if the server is returning something, but just not the json response. THe perl code seems fine..well no syntax error anyway. I tried to get it to print out a log file in the cgi-bin directory, but there are probably no write permissions for that dir. Thinking it's a directory issue..just dunno. For such a simple thing...can't believe there are so little examples out there.

        "First thing I did. It made no difference."

        I find this hard to believe, since you're now getting some response. Perhaps you're unfimiliar with CGI programming, many links have been given in this thread providing advice for learning and debugging such things. I see tobyink has provided a working solution in reply.

        First thing I did. It made no difference. It looks as if the server is returning something, but just not the json response. THe perl code seems fine..well no syntax error anyway. I tried to get it to print out a log file in the cgi-bin directory, but there are probably no write permissions for that dir. Thinking it's a directory issue..just dunno. For such a simple thing...can't believe there are so little examples out there.

        See json return value and employ the debugging checklists

        The public_html/ in public_html/cgi-bin seems unusual

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-26 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found