use strict; use warnings; use JSON::PP; my $json = { 'book' => { 'title' => JSON::PP::true, 'pages' => 5.03 #this number } }; open my $fh, '>', 'data_out.json'; print $fh encode_json($json); #this line is in error close $fh; #### use strict; use warnings; #convert all constant numbers to objects #it converted 5.03 to an object and it caused the error use bignum; use JSON::PP; # some code where "bignum" is used # ... no bignum; # exclude bignum usage my $json = { 'book' => { 'title' => JSON::PP::true, 'pages' => 5.03 #this number } }; open my $fh, '>', 'data_out.json'; print $fh encode_json($json); #this line is in error close $fh;