in reply to Int becomes String when I convert to json
#!/usr/bin/perl use warnings; use strict; use Cpanel::JSON::XS; use Cpanel::JSON::XS::Type; my %out = (username => "", userid => "", status => "", filename => "", rawfilename => "", ticket => "", returnvalue => 0, message => ""); my $json = encode_json(\%out, {returnvalue => JSON_TYPE_INT, username => JSON_TYPE_STRING, userid => JSON_TYPE_STRING, status => JSON_TYPE_STRING, filename => JSON_TYPE_STRING, rawfilename => JSON_TYPE_STRING, ticket => JSON_TYPE_STRING, message => JSON_TYPE_STRING}); print $json;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Int becomes String when I convert to json
by bartender1382 (Beadle) on May 10, 2022 at 02:02 UTC | |
by choroba (Cardinal) on May 10, 2022 at 07:23 UTC | |
by bartender1382 (Beadle) on May 10, 2022 at 16:23 UTC | |
by choroba (Cardinal) on May 10, 2022 at 20:18 UTC | |
by bartender1382 (Beadle) on May 10, 2022 at 23:52 UTC | |
|