A while ago I started on a data dumper that wasn't designed to be eval-able (like Data::Dumper) but human-readable and - more importantly - accurate.
I've just more-or-less finished the first version which fairly decently meets these goals, by doing a breadth-first walk and making use of B to analyze the data.
An example of what Data::XDumper does:
with default settings produces the output:use Data::XDumper qw(Dump); sub Test { unshift @_, { y => \@_ }; \@_ } my $x = "foo"; my $data = Test($x, substr($x, 1, 2)); bless $data, 'Quux'; bless \$data, 'Bar'; Dump $data, $data;
$L001: Bar \ @L003: Quux @( {y => \@L003}, $L002: 'foo', substr($L002, 1, 2) ) $L001Here are direct links to the sources: Data::XDumper 1.03 and its prerequisite B::More 1.01. You can also browse them at CPAN.
•Update: found a major memory leak, fixed Feb 20 13:11:50 CET 2003 in 1.03
And a syntax-highlighted version for online reading (also updated)
I hope I can get some feedback on my approach and layout, and I need to know how robust it is. I've tried all kinds of input but the possibilities are endless, so perhaps other people can find things it breaks on.
•Update: what I mean with the above paragraph is: Could you please run the most disgusting piece of data you can think of through XDumper and report the results? :-)
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: Data::XDumper
by merlyn (Sage) on Feb 16, 2003 at 16:21 UTC | |
by xmath (Hermit) on Feb 16, 2003 at 16:29 UTC | |
by merlyn (Sage) on Feb 16, 2003 at 16:42 UTC | |
by demerphq (Chancellor) on Feb 16, 2003 at 17:08 UTC | |
by xmath (Hermit) on Feb 16, 2003 at 16:49 UTC | |
by xmath (Hermit) on Feb 16, 2003 at 19:28 UTC | |
Re: Data::XDumper
by demerphq (Chancellor) on Feb 17, 2003 at 04:48 UTC | |
Re: Data::XDumper
by demerphq (Chancellor) on Feb 17, 2003 at 15:50 UTC | |
by xmath (Hermit) on Feb 17, 2003 at 18:04 UTC | |
by demerphq (Chancellor) on Feb 17, 2003 at 18:36 UTC | |
by xmath (Hermit) on Feb 17, 2003 at 18:56 UTC | |
XDumper Grammar
by xmath (Hermit) on Feb 17, 2003 at 23:37 UTC |
Back to
Meditations