Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 43244
Status: resolved
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: RADEK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.12
Fixed in: (no value)



Subject: Valid numeric values are quoted
Current behaviour: $ perl -MJSON -le 'my $number = 42; print to_json([$number]); "$number"; print to_json([$number])' [42] ["42"] Expected behaviour: both results are '[42]'. It still is a valid number, even if in the 2nd case it does have the pPOK in addition to pIOK.
Show quoted text
> Expected behaviour: both results are '[42]'. It still is a valid > number, even if in the 2nd case it does have the pPOK in addition to pIOK.
It works correctly. Please see to the JSON(and JSON::XS) documentation. The section 'MAPPING - PERL_->_JSON' says this behaviour. If you want a changing the behaviour, please send your suggestion in e-mail to JSON::XS author or me. Thanks,