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