Package: libjson-xs-perl
Version: 2.270-1
Severity: important
The documentation says this:
$perl_scalar = $json->decode ($json_text)
The opposite of "encode": expects a JSON text and tries to parse it,
returning the resulting simple scalar or reference. Croaks on error.
JSON numbers and strings become simple Perl scalars. JSON arrays
become
Perl arrayrefs and JSON objects become Perl hashrefs. "true" becomes
1,
"false" becomes 0 and "null" becomes "undef".
But this example
use JSON::XS ();
use Data::Dumper;
print Dumper(JSON::XS->new->decode('{"test":true}'));
results in the following output:
$VAR1 = {
'test' => bless( do{\(my $o = 1)}, 'JSON::XS::Boolean' )
};
Expected output, based on the documentation, is:
$VAR1 = {
'test' => 1
};
--
Florian Weimer <[email protected]>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]