http://qs321.pair.com?node_id=1205027


in reply to how to decode JSON::PP::Boolean

The value you are retrieving from $decoded2->{HasAttachments} needs to be treated as a true or false value in your code - it does not need further decoding:
use JSON; use Data::Dumper; my $json = encode_json( {HasAttachments => \0} ); # \0 is JSON false my $decoded = decode_json( $json ); print Dumper( $decoded->{HasAttachments} ); if ( $decoded->{HasAttachments} ) { print "HasAttachments is true"; } else { print "HasAttachments is false"; } # Prints: $VAR1 = bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ); HasAttachments is false