Reputation: 42435
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?
Upvotes: 2
Views: 219
Reputation: 2490
Set AUTOCONVERT
to a false value, i.e.:
$JSON::AUTOCONVERT = 0;
Upvotes: 6