1Dumpvalue(3pm) Perl Programmers Reference Guide Dumpvalue(3pm)
2
3
4
6 Dumpvalue - provides screen dump of Perl data.
7
9 use Dumpvalue;
10 my $dumper = Dumpvalue->new;
11 $dumper->set(globPrint => 1);
12 $dumper->dumpValue(\*::);
13 $dumper->dumpvars('main');
14 my $dump = $dumper->stringify($some_value);
15
17 Creation
18 A new dumper is created by a call
19
20 $d = Dumpvalue->new(option1 => value1, option2 => value2)
21
22 Recognized options:
23
24 "arrayDepth", "hashDepth"
25 Print only first N elements of arrays and hashes. If false, prints
26 all the elements.
27
28 "compactDump", "veryCompact"
29 Change style of array and hash dump. If true, short array may be
30 printed on one line.
31
32 "globPrint"
33 Whether to print contents of globs.
34
35 "dumpDBFiles"
36 Dump arrays holding contents of debugged files.
37
38 "dumpPackages"
39 Dump symbol tables of packages.
40
41 "dumpReused"
42 Dump contents of "reused" addresses.
43
44 "tick", "quoteHighBit", "printUndef"
45 Change style of string dump. Default value of "tick" is "auto",
46 one can enable either double-quotish dump, or single-quotish by
47 setting it to """ or "'". By default, characters with high bit set
48 are printed as is. If "quoteHighBit" is set, they will be quoted.
49
50 "usageOnly"
51 rudimentary per-package memory usage dump. If set, "dumpvars"
52 calculates total size of strings in variables in the package.
53
54 unctrl
55 Changes the style of printout of strings. Possible values are
56 "unctrl" and "quote".
57
58 subdump
59 Whether to try to find the subroutine name given the reference.
60
61 bareStringify
62 Whether to write the non-overloaded form of the stringify-
63 overloaded objects.
64
65 quoteHighBit
66 Whether to print chars with high bit set in binary or "as is".
67
68 stopDbSignal
69 Whether to abort printing if debugger signal flag is raised.
70
71 Later in the life of the object the methods may be queries with get()
72 method and set() method (which accept multiple arguments).
73
74 Methods
75 dumpValue
76 $dumper->dumpValue($value);
77 $dumper->dumpValue([$value1, $value2]);
78
79 Prints a dump to the currently selected filehandle.
80
81 dumpValues
82 $dumper->dumpValues($value1, $value2);
83
84 Same as "$dumper->dumpValue([$value1, $value2]);".
85
86 stringify
87 my $dump = $dumper->stringify($value [,$noticks] );
88
89 Returns the dump of a single scalar without printing. If the second
90 argument is true, the return value does not contain enclosing
91 ticks. Does not handle data structures.
92
93 dumpvars
94 $dumper->dumpvars('my_package');
95 $dumper->dumpvars('my_package', 'foo', '~bar$', '!......');
96
97 The optional arguments are considered as literal strings unless
98 they start with "~" or "!", in which case they are interpreted as
99 regular expressions (possibly negated).
100
101 The second example prints entries with names "foo", and also
102 entries with names which ends on "bar", or are shorter than 5
103 chars.
104
105 set_quote
106 $d->set_quote('"');
107
108 Sets "tick" and "unctrl" options to suitable values for printout
109 with the given quote char. Possible values are "auto", "'" and
110 """.
111
112 set_unctrl
113 $d->set_unctrl('unctrl');
114
115 Sets "unctrl" option with checking for an invalid argument.
116 Possible values are "unctrl" and "quote".
117
118 compactDump
119 $d->compactDump(1);
120
121 Sets "compactDump" option. If the value is 1, sets to a reasonable
122 big number.
123
124 veryCompact
125 $d->veryCompact(1);
126
127 Sets "compactDump" and "veryCompact" options simultaneously.
128
129 set
130 $d->set(option1 => value1, option2 => value2);
131
132 get
133 @values = $d->get('option1', 'option2');
134
135
136
137perl v5.34.0 2021-10-18 Dumpvalue(3pm)