Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 26730
Status: resolved
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: glee [...] kuchbi.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Possible bug?? -- true/false handling in JSON-1.11
Date: Thu, 26 Apr 2007 14:24:58 -0700
To: bug-JSON [...] rt.cpan.org
From: George Lee <glee [...] kuchbi.com>
Trying to use your perl module to talk to a java servlet. The servlet returns: {"readAllowed":true} but that seems to turn into false on my end. Is this a bug or am I doing the wrong thing. The JSON::NotString with value true keeps evaluating as false in a boolean context. my $http_resp = $ua->get ($url); my $json_data = $http_resp->content(); $r->log_error (Dumper($json_data)); $r->log_error ("parsing response"); my $rdata = jsonToObj($json_data); my %data = %$rdata; if (ref ($data{readAllowed})) { $r->log_error ("Is a reference -- " . ref ($data{readAllowed}) . " with value " . $data{readAllowed}); } if ($data{readAllowed}) { return Apache2::Const::OK; } else { return Apache2::Const::FORBIDDEN; } When I run this I get this output [Thu Apr 26 14:09:06 2007] [error] $VAR1 = '{"readAllowed":true}';\n [Thu Apr 26 14:09:06 2007] [error] parsing response [Thu Apr 26 14:09:06 2007] [error] Is a reference -- JSON::NotString with value true [Thu Apr 26 14:09:06 2007] [error] [client 0.0.0.0] client denied by server configuration: D:/kuchbi/views/trunk/groupfile/3/img_27795.jpg thanks!
From: makamaka [...] cpan.org
Hi, I tried to reproduce it. However, it was unreproducible. Please more information. Thanks.
Subject: Re: [rt.cpan.org #26730] Possible bug?? -- true/false handling in JSON-1.11
Date: Tue, 01 May 2007 15:03:59 -0700
To: bug-JSON [...] rt.cpan.org
From: George Lee <glee [...] kuchbi.com>
You can close this bug. There was no problem with JSON but with apache which denied me access even when the JSON string evaluated to true. sorry via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=26730 > > > Hi, > > I tried to reproduce it. However, it was unreproducible. > Please more information. > > Thanks. > > > >
Thanks.