C<SvREFCNT_dec()> which can query, increment, and decrement reference
counts on SVs. This document will take a passive, and safe, approach
to data debugging and for that it will describe only the C<Dump()>
-function.
+function. For format of output of mstats() see
+L<perldebug/Using C<$ENV{PERL_DEBUG_MSTATS}>>.
Function C<DumpArray()> allows dumping of multiple values (useful when you
need to analize returns of functions).
Let's begin by looking a simple scalar which is holding a string.
- use Devel::Peek 'Dump';
+ use Devel::Peek;
$a = "hello";
Dump $a;
If the scalar contains a number the raw SV will be leaner.
- use Devel::Peek 'Dump';
+ use Devel::Peek;
$a = 42;
Dump $a;
If the scalar from the previous example had an extra reference:
- use Devel::Peek 'Dump';
+ use Devel::Peek;
$a = 42;
$b = \$a;
Dump $a;
This shows what a reference looks like when it references a simple scalar.
- use Devel::Peek 'Dump';
+ use Devel::Peek;
$a = 42;
$b = \$a;
Dump $b;
This shows what a reference to an array looks like.
- use Devel::Peek 'Dump';
+ use Devel::Peek;
$a = [42];
Dump $a;
The following shows the raw form of a reference to a hash.
- use Devel::Peek 'Dump';
+ use Devel::Peek;
$a = {hello=>42};
Dump $a;
toplevel array or hash. This number can be increased by supplying a
second argument to the function.
- use Devel::Peek 'Dump';
+ use Devel::Peek;
$a = [10,11,12,13,14];
Dump $a;
SV *dumpop = perl_get_sv("Devel::Peek::dump_ops", FALSE);
I32 save_dumpindent = PL_dumpindent;
PL_dumpindent = 2;
- do_sv_dump(0, PerlIO_stderr(), sv, 0, 4, dumpop && SvTRUE(dumpop), pv_lim);
+ do_sv_dump(0, PerlIO_stderr(), sv, 0, lim, dumpop && SvTRUE(dumpop), pv_lim);
PL_dumpindent = save_dumpindent;
}