in reply to Re^3: Outputting JSON with sorted names/keys (Updated)
in thread Outputting JSON with sorted names/keys
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Outputting JSON with sorted names/keys (Updated)
by pryrt (Abbot) on Jun 20, 2023 at 16:50 UTC |