in reply to Can I prevent JSON encode from converting values

As far as I know the JSON format is basically "JavaScript" and as such it does not reliably know whether a string that could be a number, or a number that could be a string, are one fundamental type or another.
  • Comment on Re: Can I prevent JSON encode from converting values

Replies are listed 'Best First'.
Re^2: Can I prevent JSON encode from converting values
by tobyink (Canon) on Jul 20, 2012 at 22:55 UTC

    JSON (and Javascript for that matter) distinguishes between integers and strings; it's Perl that does not.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'