Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/man/2perl/Dumpvalue

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Dumpvalue 3"
.TH Dumpvalue 3 "2002-11-24" "perl v5.8.0" "Perl Programmers Reference Guide"
.SH "NAME"
Dumpvalue \- provides screen dump of Perl data.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 6
\&  use Dumpvalue;
\&  my $dumper = new Dumpvalue;
\&  $dumper->set(globPrint => 1);
\&  $dumper->dumpValue(\e*::);
\&  $dumper->dumpvars('main');
\&  my $dump = $dumper->stringify($some_value);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.Sh "Creation"
.IX Subsection "Creation"
A new dumper is created by a call
.PP
.Vb 1
\&  $d = new Dumpvalue(option1 => value1, option2 => value2)
.Ve
.PP
Recognized options:
.ie n .IP """arrayDepth""\fR, \f(CW""hashDepth""" 4
.el .IP "\f(CWarrayDepth\fR, \f(CWhashDepth\fR" 4
.IX Item "arrayDepth, hashDepth"
Print only first N elements of arrays and hashes.  If false, prints all the
elements.
.ie n .IP """compactDump""\fR, \f(CW""veryCompact""" 4
.el .IP "\f(CWcompactDump\fR, \f(CWveryCompact\fR" 4
.IX Item "compactDump, veryCompact"
Change style of array and hash dump.  If true, short array
may be printed on one line.
.ie n .IP """globPrint""" 4
.el .IP "\f(CWglobPrint\fR" 4
.IX Item "globPrint"
Whether to print contents of globs.
.ie n .IP """dumpDBFiles""" 4
.el .IP "\f(CWdumpDBFiles\fR" 4
.IX Item "dumpDBFiles"
Dump arrays holding contents of debugged files.
.ie n .IP """dumpPackages""" 4
.el .IP "\f(CWdumpPackages\fR" 4
.IX Item "dumpPackages"
Dump symbol tables of packages.
.ie n .IP """dumpReused""" 4
.el .IP "\f(CWdumpReused\fR" 4
.IX Item "dumpReused"
Dump contents of \*(L"reused\*(R" addresses.
.ie n .IP """tick""\fR, \f(CW""quoteHighBit""\fR, \f(CW""printUndef""" 4
.el .IP "\f(CWtick\fR, \f(CWquoteHighBit\fR, \f(CWprintUndef\fR" 4
.IX Item "tick, quoteHighBit, printUndef"
Change style of string dump.  Default value of \f(CW\*(C`tick\*(C'\fR is \f(CW\*(C`auto\*(C'\fR, one
can enable either double-quotish dump, or single-quotish by setting it
to \f(CW\*(C`"\*(C'\fR or \f(CW\*(C`'\*(C'\fR.  By default, characters with high bit set are printed
\&\fIas is\fR.  If \f(CW\*(C`quoteHighBit\*(C'\fR is set, they will be quoted.
.ie n .IP """usageOnly""" 4
.el .IP "\f(CWusageOnly\fR" 4
.IX Item "usageOnly"
rudimentally per-package memory usage dump.  If set,
\&\f(CW\*(C`dumpvars\*(C'\fR calculates total size of strings in variables in the package.
.IP "unctrl" 4
.IX Item "unctrl"
Changes the style of printout of strings.  Possible values are
\&\f(CW\*(C`unctrl\*(C'\fR and \f(CW\*(C`quote\*(C'\fR.
.IP "subdump" 4
.IX Item "subdump"
Whether to try to find the subroutine name given the reference.
.IP "bareStringify" 4
.IX Item "bareStringify"
Whether to write the non-overloaded form of the stringify-overloaded objects.
.IP "quoteHighBit" 4
.IX Item "quoteHighBit"
Whether to print chars with high bit set in binary or \*(L"as is\*(R".
.IP "stopDbSignal" 4
.IX Item "stopDbSignal"
Whether to abort printing if debugger signal flag is raised.
.PP
Later in the life of the object the methods may be queries with \fIget()\fR
method and \fIset()\fR method (which accept multiple arguments).
.Sh "Methods"
.IX Subsection "Methods"
.IP "dumpValue" 4
.IX Item "dumpValue"
.Vb 2
\&  $dumper->dumpValue($value);
\&  $dumper->dumpValue([$value1, $value2]);
.Ve
.Sp
Prints a dump to the currently selected filehandle.
.IP "dumpValues" 4
.IX Item "dumpValues"
.Vb 1
\&  $dumper->dumpValues($value1, $value2);
.Ve
.Sp
Same as \f(CW\*(C` $dumper\-\*(C'\fRdumpValue([$value1, \f(CW$value2\fR]); >.
.IP "stringify" 4
.IX Item "stringify"
.Vb 1
\&  my $dump = $dumper->stringify($value [,$noticks] );
.Ve
.Sp
Returns the dump of a single scalar without printing. If the second
argument is true, the return value does not contain enclosing ticks.
Does not handle data structures.
.IP "dumpvars" 4
.IX Item "dumpvars"
.Vb 2
\&  $dumper->dumpvars('my_package');
\&  $dumper->dumpvars('my_package', 'foo', '~bar$', '!......');
.Ve
.Sp
The optional arguments are considered as literal strings unless they
start with \f(CW\*(C`~\*(C'\fR or \f(CW\*(C`!\*(C'\fR, in which case they are interpreted as regular
expressions (possibly negated).
.Sp
The second example prints entries with names \f(CW\*(C`foo\*(C'\fR, and also entries
with names which ends on \f(CW\*(C`bar\*(C'\fR, or are shorter than 5 chars.
.IP "set_quote" 4
.IX Item "set_quote"
.Vb 1
\&  $d->set_quote('"');
.Ve
.Sp
Sets \f(CW\*(C`tick\*(C'\fR and \f(CW\*(C`unctrl\*(C'\fR options to suitable values for printout with the
given quote char.  Possible values are \f(CW\*(C`auto\*(C'\fR, \f(CW\*(C`'\*(C'\fR and \f(CW\*(C`"\*(C'\fR.
.IP "set_unctrl" 4
.IX Item "set_unctrl"
.Vb 1
\&  $d->set_unctrl('"');
.Ve
.Sp
Sets \f(CW\*(C`unctrl\*(C'\fR option with checking for an invalid argument.
Possible values are \f(CW\*(C`unctrl\*(C'\fR and \f(CW\*(C`quote\*(C'\fR.
.IP "compactDump" 4
.IX Item "compactDump"
.Vb 1
\&  $d->compactDump(1);
.Ve
.Sp
Sets \f(CW\*(C`compactDump\*(C'\fR option.  If the value is 1, sets to a reasonable
big number.
.IP "veryCompact" 4
.IX Item "veryCompact"
.Vb 1
\&  $d->veryCompact(1);
.Ve
.Sp
Sets \f(CW\*(C`compactDump\*(C'\fR and \f(CW\*(C`veryCompact\*(C'\fR options simultaneously.
.IP "set" 4
.IX Item "set"
.Vb 1
\&  $d->set(option1 => value1, option2 => value2);
.Ve
.IP "get" 4
.IX Item "get"
.Vb 1
\&  @values = $d->get('option1', 'option2');
.Ve

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].