Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Preserve the order in JSON

by Discipulus (Canon)
on Sep 11, 2023 at 07:35 UTC ( [id://11154366] : note . print w/replies, xml ) Need Help??

in reply to Re^2: Preserve the order in JSON
in thread Preserve the order in JSON

Hello Deven,

nice! as side note you can force JSON::PP to always order keys alphabetically using canonical or giving it a custom order function: JSON::PP#sort_by thus avoiding monkey patching.


There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.