in reply to Sorting Data::Dumper Output
Sice Data::Dumper uses XS (ie is written in C) hacking the source to get what you want is less than trivial. I wanted this myself a while ago. Here is a hack that reformats the standard Data::Dumper output and sorts on keys - it produces the output you expect, just sorted:
Made sub recursive and added some options for numeric, alpha or auto choice sort and optional array sorting. It now sorts all elements to whatever depth
Code has been moved to snippets Sort Data::Dumper Output and patched to correctly handle AoH and AoA constructs
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|