When I looked in the docs of JSON::XS I found pretty much the the same paragraph as in the docs of JSON::PP
$json = $json->canonical ($enable)
$enabled = $json->get_canonical
If $enable is true (or missing), then the encode method will output JSON objects by sorting their keys. This is adding a comparatively high overhead.
Use of canonical fixed my problem... and it will work in both.
In reply to Re^4: Outputting JSON with sorted names/keys (Updated)
by bart
in thread Outputting JSON with sorted names/keys
by pryrt
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |