<LI><A HREF="#configuration variables or methods">Configuration Variables or Methods</A></LI>
<LI><A HREF="#exports">Exports</A></LI>
</UL>
<LI><A HREF="#examples">EXAMPLES</A></LI>
<LI><A HREF="#bugs">BUGS</A></LI>
<LI><A HREF="#author">AUTHOR</A></LI>
<LI><A HREF="#version">VERSION</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Data::Dumper - stringified perl data structures, suitable for both printing and <A HREF="../../lib/Pod/perlfunc.html#item_eval"><CODE>eval</CODE></A></P>
<P>Given a list of scalars or reference variables, writes out their contents in
perl syntax. The references can also be objects. The contents of each
variable is output in a single Perl statement. Handles self-referential
structures correctly.</P>
<P>The return value can be <A HREF="../../lib/Pod/perlfunc.html#item_eval"><CODE>eval</CODE></A>ed to get back an identical copy of the
original reference structure.</P>
<P>Any references that are the same as one of those passed in will be named
<CODE>$VAR</CODE><EM>n</EM> (where <EM>n</EM> is a numeric suffix), and other duplicate references
to substructures within <CODE>$VAR</CODE><EM>n</EM> will be appropriately labeled using arrow
notation. You can specify names for individual values to be dumped if you
use the <A HREF="#item_Dump"><CODE>Dump()</CODE></A> method, or you can change the default <CODE>$VAR</CODE> prefix to
something else. See <CODE>$Data::Dumper::Varname</CODE> and <CODE>$Data::Dumper::Terse</CODE>
below.</P>
<P>The default output of self-referential structures can be <A HREF="../../lib/Pod/perlfunc.html#item_eval"><CODE>eval</CODE></A>ed, but the
nested references to <CODE>$VAR</CODE><EM>n</EM> will be undefined, since a recursive
structure cannot be constructed using one Perl statement. You should set the
<A HREF="#item_Purity"><CODE>Purity</CODE></A> flag to 1 to get additional statements that will correctly fill in
these references.</P>
<P>In the extended usage form, the references to be dumped can be given
user-specified names. If a name begins with a <CODE>*</CODE>, the output will
describe the dereferenced type of the supplied reference for hashes and
arrays, and coderefs. Output of names will be avoided where possible if
the <A HREF="#item_Terse"><CODE>Terse</CODE></A> flag is set.</P>
<P>In many cases, methods that are used to set the internal state of the
object will return the object itself, so method calls can be conveniently
chained together.</P>
<P>Several styles of output are possible, all controlled by setting
the <A HREF="#item_Indent"><CODE>Indent</CODE></A> flag. See <A HREF="#configuration variables or methods">Configuration Variables or Methods</A> below
<P>Due to limitations of Perl subroutine call semantics, you cannot pass an
array or hash. Prepend it with a <CODE>\</CODE> to pass its reference instead. This
will be remedied in time, with the arrival of prototypes in later versions
of Perl. For now, you need to use the extended usage form, and prepend the
name with a <CODE>*</CODE> to output it as a hash or array.</P>
<P><CODE>Data::Dumper</CODE> cheats with CODE references. If a code reference is
encountered in the structure being processed, an anonymous subroutine that
contains the string '``DUMMY''' will be inserted in its place, and a warning
will be printed if <A HREF="#item_Purity"><CODE>Purity</CODE></A> is set. You can <A HREF="../../lib/Pod/perlfunc.html#item_eval"><CODE>eval</CODE></A> the result, but bear
in mind that the anonymous sub that gets created is just a placeholder.
Someday, perl will have a switch to cache-on-demand the string
representation of a compiled piece of code, I hope. If you have prior
knowledge of all the code refs that your data structures are likely
to have, you can use the <A HREF="#item_Seen"><CODE>Seen</CODE></A> method to pre-seed the internal reference
table and make the dumped output point to them, instead. See <EM>EXAMPLES</EM>
above.</P>
<P>The <A HREF="#item_Useqq"><CODE>Useqq</CODE></A> flag makes <A HREF="#item_Dump"><CODE>Dump()</CODE></A> run slower, since the XSUB implementation
does not support it.</P>
<P>SCALAR objects have the weirdest looking <A HREF="../../lib/Pod/perlfunc.html#item_bless"><CODE>bless</CODE></A> workaround.</P>