summaryrefslogtreecommitdiffstats
path: root/upstream/mageia-cauldron/man3pm/Dumpvalue.3pm
blob: 6abf0f8a61f257c4fa412fc9c027da10350e7e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.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
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Dumpvalue 3pm"
.TH Dumpvalue 3pm 2023-11-28 "perl v5.38.2" "Perl Programmers Reference Guide"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
Dumpvalue \- provides screen dump of Perl data.
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 6
\&  use Dumpvalue;
\&  my $dumper = Dumpvalue\->new;
\&  $dumper\->set(globPrint => 1);
\&  $dumper\->dumpValue(\e*::);
\&  $dumper\->dumpvars(\*(Aqmain\*(Aq);
\&  my $dump = $dumper\->stringify($some_value);
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
.SS Creation
.IX Subsection "Creation"
A new dumper is created by a call
.PP
.Vb 1
\&  $d = Dumpvalue\->new(option1 => value1, option2 => value2)
.Ve
.PP
Recognized options:
.ie n .IP """arrayDepth"", ""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"", ""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 "reused" addresses.
.ie n .IP """tick"", ""quoteHighBit"", ""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`\*(Aq\*(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"
rudimentary 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 "as is".
.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 \fBget()\fR
method and \fBset()\fR method (which accept multiple arguments).
.SS 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\->dumpValue([$value1, $value2]);\*(C'\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(\*(Aqmy_package\*(Aq);
\&  $dumper\->dumpvars(\*(Aqmy_package\*(Aq, \*(Aqfoo\*(Aq, \*(Aq~bar$\*(Aq, \*(Aq!......\*(Aq);
.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(\*(Aq"\*(Aq);
.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`\*(Aq\*(C'\fR and \f(CW\*(C`"\*(C'\fR.
.IP set_unctrl 4
.IX Item "set_unctrl"
.Vb 1
\&  $d\->set_unctrl(\*(Aqunctrl\*(Aq);
.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(\*(Aqoption1\*(Aq, \*(Aqoption2\*(Aq);
.Ve