http://www.perlmonks.org?node_id=1043939


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

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.

Replies are listed 'Best First'.
Re^5: json return value
by stenasc (Novice) on Jul 13, 2013 at 20:56 UTC

    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