zerohero has asked for the wisdom of the Perl Monks concerning the following question:
I'm fairly certain there are a few elegant ways to do this that will obviate me hacking my own solution.
I'm using Dumper to print recursive structures (nested anonymous, hashes, arrays, etc.), i.e. print Dumper ($v), "\n". The one thing I'd like to improve is that Dumper prints everything on its own line (hash braces, array braces, single items), for simplicity. It would be nice if I could pass the string from Dumper to a pretty printer that put a few things on a line (depending on a specified width perhaps). So some routine that will transform Dumper output and make it more "horizontally oriented." It would be best if the output was "eval-able" like Dumper.
Anyone care to share their favorite way of doing this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pretty printing of Data::Dumper (and other recursive structures)
by samtregar (Abbot) on Feb 05, 2009 at 18:19 UTC | |
|
Re: Pretty printing of Data::Dumper (and other recursive structures)
by zentara (Cardinal) on Feb 05, 2009 at 17:39 UTC | |
|
Re: Pretty printing of Data::Dumper (and other recursive structures)
by planetscape (Chancellor) on Feb 05, 2009 at 19:04 UTC |