Data-Dumper-Interp
view release on metacpan or search on metacpan
lib/Data/Dumper/Interp.pm view on Meta::CPAN
"$VAR1" is an artifact of how Data::Dumper would generate code
using its "Purity" feature.
Data::Dumper::Interp simply passes through these annotations.
However with I<Refaddr(true)>, multiple references to the same thing
will all show the address of the referenced thing.
=item threads::shared support
When the address of a shared variable is shown
(e.d. when the B<Refaddr> option is enabled or if calling B<addrvis()>),
the variable's I<globally unique ID> shown instead of the C<refaddr>.
(The C<refaddr> of a shared variable is misleading; it refers
to a thread-local intermediary and may be different in
each thread even though the same shared object is being referenced).
Relatedly, the C<$VAR> references in default Data::Dumper output are
generally incorrect when shared variables are involved because Data::Dumper
uses only C<refaddr> values to identify refs to the same item.
Enabling I<Refaddr(true)> will show linkage correctly, albiet in a different way.
=item The special "_" stat filehandle may not be preserved
Data::Dumper::Interp queries the operating
system for the window size to initialize C<$Foldwidth>, if it
is not already defined; this may change the "_" filehandle.
After the first call (or if you pre-set C<$Foldwidth>),
the "_" filehandle will not change across calls.
=back
=head1 DIFFERENCES FROM Data::Dumper
Results differ from plain C<Data::Dumper> output in the following ways
(most of these can be controlled via Config options):
=over 2
=item *
Punctuation variables such as $@, $!, and $?, are preserved over calls.
=item *
A final newline is I<never> included.
Everything is shown on a single line if possible, otherwise wrapped to
your terminal width (or C<$Foldwidth>), with indented structure levels.
=item *
Printable Unicode characters appear as themselves instead of \x{ABCD}.
Note: If your data contains 'wide characters', you should
C<< use open IO => ':locale'; >> or otherwise arrange to
encode the output for your terminal.
You'll also want C<< use utf8; >> if your Perl source is written
using utf8 characters outside the ASCII range.
Undecoded binary octets (e.g. data read from a 'binmode' file)
will still be escaped as individual bytes.
=item *
Depending on options, spaces·may·be·shown·visibly
and 'â¤' may be shown for newline (and similarly for other ASCII controls).
"White space" characters in qr/compiled regex/ are shown as \t, \n etc.
=item *
CODE refs show the name of the referenced sub using L<Sub::Identify>
instead of C<sub{ "DUMMY" }>. If the sub is anonymous, the file:lineno
where it was defined is shown.
=item *
The internals of objects are not shown by default.
If stringifcation is overloaded it is used to obtain the object's
representation. For example, C<bignum> and C<bigrat> numbers are shown as easily
readable values rather than S<"bless( {...}, 'Math::...')">.
Stingified objects are prefixed with "(classname)" to make clear what
happened.
The "virtual" value of objects which overload a dereference operator
(C<@{}> or C<%{}>) is displayed instead of the object's internals.
=item *
Hash keys are sorted treating numeric "components" numerically.
For example "A.20" sorts before "A.100".
=item *
Numbers and strings which look like numbers are kept distinct when displayed,
i.e. "0" does not become 0 or vice-versa. Floating-point values are shown
as numbers not 'quoted strings'.
Although such differences might be immaterial to Perl during execution,
they may be important when communicating to a human.
=item *
References to shared variables (see L<threads::shared>) are shown correctly
with the C<Refaddr> feature. Data::Dumper's C<$VAR> expressions are usually
incorrect when shared variables are involved.
=back
=head1 SEE ALSO
Data::Dumper
=head1 AUTHOR
Jim Avera (jim.avera AT gmail)
=head1 LICENSE
( run in 1.381 second using v1.01-cache-2.11-cpan-751830e7986 )