<?xml version="1.0" encoding="windows-1252"?>
<node id="433537" title="In need of a Dumper that has no pretentions to being anything else." created="2005-02-22 20:23:19" updated="2005-08-11 08:23:35">
<type id="115">
perlquestion</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;p&gt;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?

&lt;ol&gt;&lt;li&gt;Dumps what's in the structure without attempting to analyse it. 

&lt;p&gt;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.

&lt;p&gt;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.

&lt;/li&gt;&lt;li&gt;Dumps the contents in a compact, but "structured" manner (read indented).

&lt;/li&gt;&lt;li&gt;Produces sensibly compact output that looks roughly the way I might key it in--without trying to make the output [eval]able.

&lt;p&gt;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!

&lt;p&gt;ie. somthing like:

&lt;code&gt;
{ a =&gt; [ 1, 2, 3 ],
  b =&gt; [
         { X =&gt; 1, Y=&gt; 2 }
         { X =&gt; [ 1, 2, 3], Y=&gt; [ 4, 5, 6 ], Z =&gt; [ 7, 8, 9 ] },
  c =&gt; 'fred',
}
&lt;/code&gt;

&lt;p&gt;Not YAML!

&lt;p&gt;Preferably a function rather than an object.

&lt;/li&gt;&lt;/ol&gt;



&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;Examine what is said, not who speaks.&lt;/div&gt;
&lt;div&gt;Silence betokens consent.&lt;/div&gt;
&lt;div&gt;Love the truth but pardon error.&lt;/div&gt;
&lt;/font&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
