Is there a way to force quotation of numbers in JSON 1.x Perl module?
Test script
use JSON;
$\ = "\n";
my $big_number = '12345678901234567890123456';
print $big_number;
print objToJson([$big_number]);
Output (JSON 1.07, Perl 5.8.7)
12345678901234567890123456
[12345678901234567890123456]
Output (JSON 2.15, Perl 5.10.1)
12345678901234567890123456
[开发者_开发问答"12345678901234567890123456"]
I'd like to have strings representing numbers being quoted when using JSON 1.x the same way they are being quoted when using JSON 2.x. Is there any way to direct JSON 1.x Perl module to do this?
Set AUTOCONVERT
to a false value, i.e.:
$JSON::AUTOCONVERT = 0;
精彩评论