in reply to Int becomes String when I convert to json
Most likely, enum returns all values as strings.
If you want to try to convince Perl (and JSON) that the value should be treated more like a number, try adding a zero to it:
$out{returnvalue} = 0+SSSTAGE1;
... or simply do the conversion at the end:
$out{returnvalue} = 0+$out{returnvalue};
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Int becomes String when I convert to json
by Don Coyote (Hermit) on May 10, 2022 at 10:20 UTC |