Debian Codegraph @

upstream/debian-unstable/man3/Dumpvalue.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "Dumpvalue 3perl"
58 .TH Dumpvalue 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 Dumpvalue \- provides screen dump of Perl data.
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 .Vb 6
68 \& use Dumpvalue;
69 \& my $dumper = Dumpvalue\->new;
70 \& $dumper\->set(globPrint => 1);
71 \& $dumper\->dumpValue(\e*::);
72 \& $dumper\->dumpvars(\*(Aqmain\*(Aq);
73 \& my $dump = $dumper\->stringify($some_value);
74 .Ve
75 .SH DESCRIPTION
76 .IX Header "DESCRIPTION"
77 .SS Creation
78 .IX Subsection "Creation"
79 A new dumper is created by a call
80 .PP
81 .Vb 1
82 \& $d = Dumpvalue\->new(option1 => value1, option2 => value2)
83 .Ve
84 .PP
85 Recognized options:
86 .ie n .IP """arrayDepth"", ""hashDepth""" 4
87 .el .IP "\f(CWarrayDepth\fR, \f(CWhashDepth\fR" 4
88 .IX Item "arrayDepth, hashDepth"
89 Print only first N elements of arrays and hashes. If false, prints all the
90 elements.
91 .ie n .IP """compactDump"", ""veryCompact""" 4
92 .el .IP "\f(CWcompactDump\fR, \f(CWveryCompact\fR" 4
93 .IX Item "compactDump, veryCompact"
94 Change style of array and hash dump. If true, short array
95 may be printed on one line.
96 .ie n .IP """globPrint""" 4
97 .el .IP \f(CWglobPrint\fR 4
98 .IX Item "globPrint"
99 Whether to print contents of globs.
100 .ie n .IP """dumpDBFiles""" 4
101 .el .IP \f(CWdumpDBFiles\fR 4
102 .IX Item "dumpDBFiles"
103 Dump arrays holding contents of debugged files.
104 .ie n .IP """dumpPackages""" 4
105 .el .IP \f(CWdumpPackages\fR 4
106 .IX Item "dumpPackages"
107 Dump symbol tables of packages.
108 .ie n .IP """dumpReused""" 4
109 .el .IP \f(CWdumpReused\fR 4
110 .IX Item "dumpReused"
111 Dump contents of "reused" addresses.
112 .ie n .IP """tick"", ""quoteHighBit"", ""printUndef""" 4
113 .el .IP "\f(CWtick\fR, \f(CWquoteHighBit\fR, \f(CWprintUndef\fR" 4
114 .IX Item "tick, quoteHighBit, printUndef"
115 Change style of string dump. Default value of \f(CW\*(C`tick\*(C'\fR is \f(CW\*(C`auto\*(C'\fR, one
116 can enable either double-quotish dump, or single-quotish by setting it
117 to \f(CW\*(C`"\*(C'\fR or \f(CW\*(C`\*(Aq\*(C'\fR. By default, characters with high bit set are printed
118 \&\fIas is\fR. If \f(CW\*(C`quoteHighBit\*(C'\fR is set, they will be quoted.
119 .ie n .IP """usageOnly""" 4
120 .el .IP \f(CWusageOnly\fR 4
121 .IX Item "usageOnly"
122 rudimentary per-package memory usage dump. If set,
123 \&\f(CW\*(C`dumpvars\*(C'\fR calculates total size of strings in variables in the package.
124 .IP unctrl 4
125 .IX Item "unctrl"
126 Changes the style of printout of strings. Possible values are
127 \&\f(CW\*(C`unctrl\*(C'\fR and \f(CW\*(C`quote\*(C'\fR.
128 .IP subdump 4
129 .IX Item "subdump"
130 Whether to try to find the subroutine name given the reference.
131 .IP bareStringify 4
132 .IX Item "bareStringify"
133 Whether to write the non-overloaded form of the stringify-overloaded objects.
134 .IP quoteHighBit 4
135 .IX Item "quoteHighBit"
136 Whether to print chars with high bit set in binary or "as is".
137 .IP stopDbSignal 4
138 .IX Item "stopDbSignal"
139 Whether to abort printing if debugger signal flag is raised.
140 .PP
141 Later in the life of the object the methods may be queries with \fBget()\fR
142 method and \fBset()\fR method (which accept multiple arguments).
143 .SS Methods
144 .IX Subsection "Methods"
145 .IP dumpValue 4
146 .IX Item "dumpValue"
147 .Vb 2
148 \& $dumper\->dumpValue($value);
149 \& $dumper\->dumpValue([$value1, $value2]);
150 .Ve
151 .Sp
152 Prints a dump to the currently selected filehandle.
153 .IP dumpValues 4
154 .IX Item "dumpValues"
155 .Vb 1
156 \& $dumper\->dumpValues($value1, $value2);
157 .Ve
158 .Sp
159 Same as \f(CW\*(C`$dumper\->dumpValue([$value1, $value2]);\*(C'\fR.
160 .IP stringify 4
161 .IX Item "stringify"
162 .Vb 1
163 \& my $dump = $dumper\->stringify($value [,$noticks] );
164 .Ve
165 .Sp
166 Returns the dump of a single scalar without printing. If the second
167 argument is true, the return value does not contain enclosing ticks.
168 Does not handle data structures.
169 .IP dumpvars 4
170 .IX Item "dumpvars"
171 .Vb 2
172 \& $dumper\->dumpvars(\*(Aqmy_package\*(Aq);
173 \& $dumper\->dumpvars(\*(Aqmy_package\*(Aq, \*(Aqfoo\*(Aq, \*(Aq~bar$\*(Aq, \*(Aq!......\*(Aq);
174 .Ve
175 .Sp
176 The optional arguments are considered as literal strings unless they
177 start with \f(CW\*(C`~\*(C'\fR or \f(CW\*(C`!\*(C'\fR, in which case they are interpreted as regular
178 expressions (possibly negated).
179 .Sp
180 The second example prints entries with names \f(CW\*(C`foo\*(C'\fR, and also entries
181 with names which ends on \f(CW\*(C`bar\*(C'\fR, or are shorter than 5 chars.
182 .IP set_quote 4
183 .IX Item "set_quote"
184 .Vb 1
185 \& $d\->set_quote(\*(Aq"\*(Aq);
186 .Ve
187 .Sp
188 Sets \f(CW\*(C`tick\*(C'\fR and \f(CW\*(C`unctrl\*(C'\fR options to suitable values for printout with the
189 given quote char. Possible values are \f(CW\*(C`auto\*(C'\fR, \f(CW\*(C`\*(Aq\*(C'\fR and \f(CW\*(C`"\*(C'\fR.
190 .IP set_unctrl 4
191 .IX Item "set_unctrl"
192 .Vb 1
193 \& $d\->set_unctrl(\*(Aqunctrl\*(Aq);
194 .Ve
195 .Sp
196 Sets \f(CW\*(C`unctrl\*(C'\fR option with checking for an invalid argument.
197 Possible values are \f(CW\*(C`unctrl\*(C'\fR and \f(CW\*(C`quote\*(C'\fR.
198 .IP compactDump 4
199 .IX Item "compactDump"
200 .Vb 1
201 \& $d\->compactDump(1);
202 .Ve
203 .Sp
204 Sets \f(CW\*(C`compactDump\*(C'\fR option. If the value is 1, sets to a reasonable
205 big number.
206 .IP veryCompact 4
207 .IX Item "veryCompact"
208 .Vb 1
209 \& $d\->veryCompact(1);
210 .Ve
211 .Sp
212 Sets \f(CW\*(C`compactDump\*(C'\fR and \f(CW\*(C`veryCompact\*(C'\fR options simultaneously.
213 .IP set 4
214 .IX Item "set"
215 .Vb 1
216 \& $d\->set(option1 => value1, option2 => value2);
217 .Ve
218 .IP get 4
219 .IX Item "get"
220 .Vb 1
221 \& @values = $d\->get(\*(Aqoption1\*(Aq, \*(Aqoption2\*(Aq);
222 .Ve