Subject: | Custom key sort feature? |
Hi Gisle,
Are you by any chance interested in having a hook to do custom sort of hash keys? Something like this:
https://metacpan.org/release/PERLANCAR/Data-Dump-SortKeys-0.01
https://github.com/perlancar/perl-Data-Dump-SortKeys/commit/719c5ba58fe9f46e4d14980c5b96f6c4f52a86c9#diff-ee45dfc28bff1594aa5b0cadb635a159R299
My use case is having some table data in an array of hashes structure like:
[ { max=> 50_000_000, rate=>0.05},
{xmin=> 50_000_000, max=>250_000_000, rate=>0.15},
{xmin=>250_000_000, max=>500_000_000, rate=>0.25},
{xmin=>500_000_000, rate=>0.30}, ]
I would like to dump the hash keys it in the order of (xmin, max, rate) instead of the default asciibetical (max, rate, xmin).
Regards,
perlancar