NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Set indent (Score:1)
If you do
local $Data::Dumper::Indent = 1;
it will indent things in a regular way, not the ugly default way (described as "fancy" in the docs).
Re: Set indent (Score:1)
I was aware of it. ;-)
From the Pod of the above module: "Data::Dumper also provides a certain level of pretty printing via the $Data::Dumper::Indent variable but it isn't quite as nice as the Perl::Tidy output".
In particular, it doesn't do any hash element alignment on => which I find helpful when debugging.
John.
--
Did you try Data::Dump (Score:2)
Re: (Score:1)
it does alignment on => too
Does it? I tried a few examples, including the one in the docs above, and it doesn't seem to.
Anyway, I guess the point is that while there are several modules that dump data structures effectively (at least for my needs) there is only one module that does the pretty printing the way I want it (at times when I do want it) and that is Perl::Tidy. That is really what I was aiming for. :-)
John.
--
Re: (Score:2)
Don't know. I only tried the simple test below, and it did align the => signs nicely. Maybe you are talking about something else:
perl -MData::Dump -we "dd \%INC"Re: (Score:2)
it does alignment on
=>tooDoes it? I tried a few examples, including the one in the docs above, and it doesn't seem to.
There's also Data::Dump::Streamer [cpan.org], which does do alignment on
=>by default.The problem that I personally have with this module, is that I find its indentation levels are far too deep, it really sucks if your window is not 200 character wide.
You have to choose between this level of indentation, or no indentation at all.