Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Int becomes String when I convert to json

by Haarg (Priest)
on May 10, 2022 at 00:25 UTC ( [id://11143723]=note: print w/replies, xml ) Need Help??


in reply to Int becomes String when I convert to json

If at any time you use SSSTAGE1 as a string in your program, it may change how it gets converted to JSON by the JSON.pm module. JSON.pm will internally try to use JSON::XS if possible, which has a heuristic for encoding values like this that can be problematic.

If you switched to the JSON::MaybeXS module instead, it would likely work as you expected. Internally, it will try to use the Cpanel::JSON::XS module, which has better behavior for values like this than JSON::XS.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-28 21:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found