in reply to Re^2: Write json structure to a file
in thread Write json structure to a file
No. Perl hashes have no order, so the sequence in which hash keys are serialized is more or less random.
Update: Note that Javascript does not define an order over the properties of objects either, so there is very little guarantee that a JSON document will have the keys in a specific order. It seems that ECMAscript 6 standardizes somewhat on "insertion order".
The JSON definition declares that
An object is an unordered set of name/value pairs.
So, for hashes, JSON does not specify an order of the keys.
|
|---|