Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Did the JSON module change?

by ikegami (Pope)
on Mar 01, 2018 at 19:24 UTC ( #1210179=note: print w/replies, xml ) Need Help??

in reply to Did the JSON module change?

[Ignore/delete this post. I misunderstood the issue. The hash is still a red herring, but the rest doesn't apply. Differences in the choice of back-end could still be relevant, but it's not the only possibility. I don't have time to look deeper right now.]

The hash is a red herring. The results of mathematical operators are numbers, and the result of concatenation is a string. Period.

$ perl -MJSON -E' say encode_json({ a=>"7", b=>8, c=>"1"+"8", d=>1 . 0 }); ' {"a":"7","b":8,"c":9,"d":"10"}

You also asked about changes in behaviour. Keep in mind that JSON is a merely front for JSON::XS, but it defaults to using JSON::PP if JSON::XS is not available. That means its behaviour could theoretically change based on which modules you have installed.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1210179]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2020-10-31 22:59 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (291 votes). Check out past polls.