Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Getting JSON::PP:Boolean value

by stevieb (Canon)
on May 24, 2017 at 13:22 UTC ( [id://1191085]=note: print w/replies, xml ) Need Help??


in reply to Re: Getting JSON::PP:Boolean value
in thread Getting JSON::PP:Boolean value

I 100% concur here that OP is mistaken, and must be doing something wrong. I was working heavily with the JSON objectified bool last week writing my GPS software. Here's an example that illustrates what the json->perl conversion looks like, and the resulting output before/after re-assignment:

use warnings; use strict; use Data::Dumper; use JSON; my $json = '{"true": true, "false": false}'; my $perl = decode_json $json; print Dumper $perl; my $t = $perl->{true}; my $f = $perl->{false}; print "orig true: $perl->{true}, var true: $t\n"; print "orig false: $perl->{false}, var false: $f\n"; __END__ $VAR1 = { 'false' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ), 'true' => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ) }; orig true: 1, var true: 1 orig false: 0, var false: 0

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found