The return value can be eval ed to get back the original reference structure. Bear in mind that a reference so created will not preserve pointer equalities with the original reference.
Handles self-referential structures correctly. Any references that are the
same as one of those passed in will be marked In the extended usage form, the supplied references can be given
user-specified names. If a supplied name begins with a Several styles of output are possible, all controlled by setting
$Data::Dumper::Indent
or using the corresponding method name. Style 0
spews output without any newlines, indentation, or spaces between list
items. It is the most compact format possible that can still be called
valid perl. Style 1 outputs a readable form with newlines but no fancy
indentation (each level in the structure is simply indented by a fixed
amount of whitespace). Style 2 (the default) outputs a very readable form
which takes into account the length of hash keys (so the hash value lines
up). Style 3 is like style 2, but also annotates the elements of arrays
with their index (but the comment is on its own line, so array output
consumes twice the number of lines).
The prefix specified by
$Data::Dumper::Varname
will be used with a
numeric suffix if the name for a value is undefined.
The second form, for convenience, simply calls the
Expects a anonymous hash of name => value pairs. Same rules apply for names
as in
These variables determine the default state of the object created by calling
the
Dumper
cheats with CODE references. If a code reference is encountered in
the structure being processed, an anonymous subroutine returning the perl
string-interpolated representation of the original CODE reference will be
inserted in its place, and a warning will be printed if SCALAR objects have the wierdest looking
bless
workaround.
Copyright (c) 1995 Gurusamy Sarathy. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
$VARI
$VARI
*
, the output
will describe the dereferenced type of the supplied reference for hashes and
arrays.
Methods
$
sign, and must be comprised of alphanumeric characters. You can begin
a name with a *
to specify that the dereferenced type must be dumped
instead of the reference itself.
new
), subject to the
configuration options below.
new
method on its
arguments before dumping the object immediately.
Reset
to explicitly clear the table if needed. Such
references are not dumped; instead, their names are inserted wherever they
are to be dumped subsequently.
new
. If no argument is supplied, will return the ``seen'' list of
name => value pairs, in an array context.
Functions
$VARI
Configuration Variables/Methods
Several configuration variables can be used to control the kind of output
generated when using the procedural interface. These variables are usually
local
ized in a block so that other parts of the code are not affected by
the change.
new
method, but cannot be used to alter the state of the object
thereafter. The equivalent method names should be used instead to query
or set the internal state of the object.
Exports
EXAMPLE
BUGS
Due to limitations of Perl subroutine call semantics, you can't pass an
array or hash. Prepend it with a \
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 *
to output it as a hash or array.
Purity
is
set. You can
eval
the result, but bear in mind that the anonymous sub
that gets created is a dummy placeholder. Someday, perl will have a switch
to cache-on-demand the string representation of a compiled piece of code, I
hope.
AUTHOR
Gurusamy Sarathy gsar@umich.edu
VERSION
Version 1.23 3 Dec 1995
SEE ALSO
perl(1)