No such thing as a small change | |
PerlMonks |
Re: Int becomes String when I convert to jsonby Haarg (Priest) |
on May 10, 2022 at 00:25 UTC ( [id://11143723]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|