Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Sorting Data::Dumper Output

by tachyon (Chancellor)
on Nov 26, 2001 at 20:50 UTC ( [id://127576]=note: print w/replies, xml ) Need Help??


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:

Update

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

Update

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://127576]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found