Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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?

  1. 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.

  2. Dumps the contents in a compact, but "structured" manner (read indented).
  3. 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.

In reply to In need of a Dumper that has no pretentions to being anything else. by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (7)
    As of 2015-07-07 07:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (87 votes), past polls