|more useful options|
Preserve the order in JSONby user786 (Sexton)
|on Jun 16, 2015 at 20:16 UTC||Need Help??|
user786 has asked for the wisdom of the Perl Monks concerning the following question:
I have written a perl script to edit the a json file.
I need to check if cp is 10000 and set custcap to 99999 if so. If the cp is not equal to 10000, just exit out of the file without making changes.
The script works as expected. It makes the necessary changes and saves the files.
however after the changes,the order of the parameters in JSON file changes>
I read the json spec, My understanding is json is unordered.
can some one help me out with preserving the order
After script execution the order of the file changes. is there a way to preserve the order ?