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

Re^3: json return value

by stenasc (Novice)
on Jul 12, 2013 at 10:18 UTC ( #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.


Comment on Re^3: json return value
Re^4: json return value
by marto (Chancellor) 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. 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

        "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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-07-12 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (236 votes), past polls