Just another Perl shrine | |
PerlMonks |
(Ovid) Re: Sorting Data::Dumper Outputby Ovid (Cardinal) |
on Nov 26, 2001 at 20:07 UTC ( [id://127556]=note: print w/replies, xml ) | Need Help?? |
Since hashes are inherently unordered (well, as far as the programmer is concerned), you're going to have some trouble doing that cleanly. One unclean way of doing that (for top level keys only) is:
However, since that breaks name/value pairs into a series of array refs, you'll probably be less than pleased with the output. You could also try Tie-SortHash-1.01. I have no idea if that would work, but the documentation suggests to me that it might. Cheers, Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In Section
Seekers of Perl Wisdom
|
|