decode_json returns an object to represent the boolean values it finds. You'll need to walk the structure returned by decode_json to replace values for which JSON::XS::is_bool($node) is true with an appropriate value (such as 0+$node or $node?'true':'false').