Data::TreeDumper
2005/01/14 filed under /perlSometimes I wonder why I have never looked into certain Perl modules before. That was the case with, for example, Class::DBI and Template (Toolkit). Today I "discovered" another one of those: Data::TreeDumper by Khemir Nadim ibn Hamouda.
I've been a fan of the Data::Dumper module for a while, but Data::TreeDumper can be so much nicer in certain situations. Compare the output of these two data structures and see why I like it:
Data::Dumper
$VAR1 = {
'etag' => 'b',
'__RULE__' => 'test',
'part(s)' => [
[
'part',
'1'
],
[
'part',
[
'content',
'data '
]
]
],
'stag' => 'b'
};
Data::TreeDumper
|- __RULE__ = test [S1] |- etag = b [S2] |- part(s) [A3] | |- 0 [A4] | | |- 0 = part [S5] | | `- 1 = 1 [S6] | `- 1 [A7] | |- 0 = part [S8] | `- 1 [A9] | |- 0 = content [S10] | `- 1 = data [S11] `- stag = b [S12]
Now isn't that layout easier on the eyes, or what? Good job, Nadim!


