in reply to Re^4: Outputting JSON with sorted names/keys (Updated)
in thread Outputting JSON with sorted names/keys

Use of canonical fixed my problem

I'm glad that the alphanumeric sort of canonical worked for you. However, use of canonical is not sufficient for the original problem that I asked: I didn't just want it sorted; I wanted it sorted in a non-traditional sort order (that is, in an order that I defined). So canonical sort is possible in both, but the arbitrary sort_by mechanism is only available in JSON::PP .