Does anyone know of a module/function which will dump a perl data structure in a compact, human readable format that doesn't aspire to being a serialisation module?
- Dumps what's in the structure without attempting to analyse it.
I don't care if the array in two or more nested arrays are references to the same array. I just want to see what's in there.
And I have no use for a module that takes up 20 times as much memory to dump the contents of a structure than the structure itself takes up.
- Dumps the contents in a compact, but "structured" manner (read indented).
- Produces sensibly compact output that looks roughly the way I might key it in--without trying to make the output evalable.
Keeps nested structures on one line if it is practical. Preferably with a setable wrap limit that I can set to 1000 or 2000 if I wish--not hard coded to wrap at 72!
ie. somthing like:
{ a => [ 1, 2, 3 ],
b => [
{ X => 1, Y=> 2 }
{ X => [ 1, 2, 3], Y=> [ 4, 5, 6 ], Z => [ 7, 8, 9 ] },
c => 'fred',
}
Not YAML!
Preferably a function rather than an object.
Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|