| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
1201
|
use 5.006_001; # for (defined ref) and $#$v and our |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
41
|
|
|
2
|
|
|
|
|
|
|
package Dumpvalue; |
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
695
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.17'; |
|
5
|
|
|
|
|
|
|
our(%address, $stab, @stab, %stab, %subs); |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# documentation nits, handle complex data structures better by chromatic |
|
8
|
|
|
|
|
|
|
# translate control chars to ^X - Randal Schwartz |
|
9
|
|
|
|
|
|
|
# Modifications to print types by Peter Gordon v1.0 |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Ilya Zakharevich -- patches after 5.001 (and some before ;-) |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Won't dump symbol tables and contents of debugged files by default |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# (IZ) changes for objectification: |
|
16
|
|
|
|
|
|
|
# c) quote() renamed to method set_quote(); |
|
17
|
|
|
|
|
|
|
# d) unctrlSet() renamed to method set_unctrl(); |
|
18
|
|
|
|
|
|
|
# f) Compiles with 'use strict', but in two places no strict refs is needed: |
|
19
|
|
|
|
|
|
|
# maybe more problems are waiting... |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my %defaults = ( |
|
22
|
|
|
|
|
|
|
globPrint => 0, |
|
23
|
|
|
|
|
|
|
printUndef => 1, |
|
24
|
|
|
|
|
|
|
tick => "auto", |
|
25
|
|
|
|
|
|
|
unctrl => 'quote', |
|
26
|
|
|
|
|
|
|
subdump => 1, |
|
27
|
|
|
|
|
|
|
dumpReused => 0, |
|
28
|
|
|
|
|
|
|
bareStringify => 1, |
|
29
|
|
|
|
|
|
|
hashDepth => '', |
|
30
|
|
|
|
|
|
|
arrayDepth => '', |
|
31
|
|
|
|
|
|
|
dumpDBFiles => '', |
|
32
|
|
|
|
|
|
|
dumpPackages => '', |
|
33
|
|
|
|
|
|
|
quoteHighBit => '', |
|
34
|
|
|
|
|
|
|
usageOnly => '', |
|
35
|
|
|
|
|
|
|
compactDump => '', |
|
36
|
|
|
|
|
|
|
veryCompact => '', |
|
37
|
|
|
|
|
|
|
stopDbSignal => '', |
|
38
|
|
|
|
|
|
|
); |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
|
41
|
1
|
|
|
1
|
0
|
872
|
my $class = shift; |
|
42
|
1
|
|
|
|
|
13
|
my %opt = (%defaults, @_); |
|
43
|
1
|
|
|
|
|
10
|
bless \%opt, $class; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub set { |
|
47
|
1
|
|
|
1
|
1
|
13
|
my $self = shift; |
|
48
|
1
|
|
|
|
|
5
|
my %opt = @_; |
|
49
|
1
|
|
|
|
|
6
|
@$self{keys %opt} = values %opt; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub get { |
|
53
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
|
54
|
2
|
50
|
|
|
|
12
|
wantarray ? @$self{@_} : $$self{pop @_}; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub dumpValue { |
|
58
|
4
|
|
|
4
|
1
|
9
|
my $self = shift; |
|
59
|
4
|
50
|
|
|
|
11
|
die "usage: \$dumper->dumpValue(value)" unless @_ == 1; |
|
60
|
4
|
|
|
|
|
8
|
local %address; |
|
61
|
4
|
|
|
|
|
14
|
local $^W=0; |
|
62
|
4
|
100
|
|
|
|
15
|
(print "undef\n"), return unless defined $_[0]; |
|
63
|
3
|
100
|
|
|
|
14
|
(print $self->stringify($_[0]), "\n"), return unless ref $_[0]; |
|
64
|
1
|
|
|
|
|
7
|
$self->unwrap($_[0],0); |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub dumpValues { |
|
68
|
3
|
|
|
3
|
1
|
7
|
my $self = shift; |
|
69
|
3
|
|
|
|
|
4
|
local %address; |
|
70
|
3
|
|
|
|
|
11
|
local $^W=0; |
|
71
|
3
|
100
|
|
|
|
10
|
(print "undef\n"), return unless defined $_[0]; |
|
72
|
2
|
|
|
|
|
9
|
$self->unwrap(\@_,0); |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# This one is good for variable names: |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub unctrl { |
|
78
|
5
|
|
|
5
|
1
|
12
|
local($_) = @_; |
|
79
|
|
|
|
|
|
|
|
|
80
|
5
|
100
|
|
|
|
24
|
return \$_ if ref \$_ eq "GLOB"; |
|
81
|
4
|
|
|
|
|
12
|
s/([\001-\037\177])/'^'.pack('c',ord($1)^64)/eg; |
|
|
1
|
|
|
|
|
10
|
|
|
82
|
4
|
|
|
|
|
24
|
$_; |
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub stringify { |
|
86
|
72
|
|
|
72
|
1
|
107
|
my $self = shift; |
|
87
|
72
|
|
|
|
|
99
|
local $_ = shift; |
|
88
|
72
|
|
|
|
|
89
|
my $noticks = shift; |
|
89
|
72
|
|
|
|
|
103
|
my $tick = $self->{tick}; |
|
90
|
|
|
|
|
|
|
|
|
91
|
72
|
100
|
100
|
|
|
192
|
return 'undef' unless defined $_ or not $self->{printUndef}; |
|
92
|
71
|
100
|
|
|
|
186
|
return $_ . "" if ref \$_ eq 'GLOB'; |
|
93
|
1
|
|
|
1
|
|
18
|
{ no strict 'refs'; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
1050
|
|
|
|
70
|
|
|
|
|
76
|
|
|
94
|
10
|
|
|
|
|
39
|
$_ = &{'overload::StrVal'}($_) |
|
|
10
|
|
|
|
|
47
|
|
|
95
|
|
|
|
|
|
|
if $self->{bareStringify} and ref $_ |
|
96
|
70
|
50
|
66
|
|
|
454
|
and %overload:: and defined &{'overload::StrVal'}; |
|
|
|
|
66
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
70
|
100
|
|
|
|
172
|
if ($tick eq 'auto') { |
|
100
|
49
|
100
|
|
|
|
131
|
if (/[\000-\011\013-\037\177]/) { |
|
101
|
4
|
|
|
|
|
8
|
$tick = '"'; |
|
102
|
|
|
|
|
|
|
} else { |
|
103
|
45
|
|
|
|
|
61
|
$tick = "'"; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
} |
|
106
|
70
|
100
|
|
|
|
130
|
if ($tick eq "'") { |
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
107
|
66
|
|
|
|
|
153
|
s/([\'\\])/\\$1/g; |
|
108
|
|
|
|
|
|
|
} elsif ($self->{unctrl} eq 'unctrl') { |
|
109
|
1
|
|
|
|
|
3
|
s/([\"\\])/\\$1/g ; |
|
110
|
1
|
|
|
|
|
6
|
s/([\000-\037\177])/'^'.pack('c',ord($1)^64)/eg; |
|
|
1
|
|
|
|
|
7
|
|
|
111
|
1
|
50
|
|
|
|
4
|
s/([\200-\377])/'\\0x'.sprintf('%2X',ord($1))/eg |
|
|
0
|
|
|
|
|
0
|
|
|
112
|
|
|
|
|
|
|
if $self->{quoteHighBit}; |
|
113
|
|
|
|
|
|
|
} elsif ($self->{unctrl} eq 'quote') { |
|
114
|
3
|
50
|
|
|
|
16
|
s/([\"\\\$\@])/\\$1/g if $tick eq '"'; |
|
115
|
3
|
|
|
|
|
9
|
s/\033/\\e/g; |
|
116
|
3
|
|
|
|
|
11
|
s/([\000-\037\177])/'\\c'.chr(ord($1)^64)/eg; |
|
|
2
|
|
|
|
|
11
|
|
|
117
|
|
|
|
|
|
|
} |
|
118
|
70
|
100
|
|
|
|
181
|
s/([\200-\377])/'\\'.sprintf('%3o',ord($1))/eg if $self->{quoteHighBit}; |
|
|
1
|
|
|
|
|
6
|
|
|
119
|
70
|
100
|
100
|
|
|
1214
|
($noticks || /^\d+(\.\d*)?\Z/) |
|
120
|
|
|
|
|
|
|
? $_ |
|
121
|
|
|
|
|
|
|
: $tick . $_ . $tick; |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub DumpElem { |
|
125
|
19
|
|
|
19
|
0
|
38
|
my ($self, $v) = (shift, shift); |
|
126
|
19
|
|
|
|
|
58
|
my $short = $self->stringify($v, ref $v); |
|
127
|
19
|
|
|
|
|
31
|
my $shortmore = ''; |
|
128
|
19
|
100
|
100
|
|
|
193
|
if ($self->{veryCompact} && ref $v |
|
|
|
100
|
66
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
129
|
|
|
|
|
|
|
&& (ref $v eq 'ARRAY' and !grep(ref $_, @$v) )) { |
|
130
|
4
|
|
|
|
|
5
|
my $depth = $#$v; |
|
131
|
4
|
100
|
100
|
|
|
20
|
($shortmore, $depth) = (' ...', $self->{arrayDepth} - 1) |
|
132
|
|
|
|
|
|
|
if $self->{arrayDepth} and $depth >= $self->{arrayDepth}; |
|
133
|
4
|
|
|
|
|
16
|
my @a = map $self->stringify($_), @$v[0..$depth]; |
|
134
|
4
|
|
|
|
|
6
|
print "0..$#{$v} @a$shortmore\n"; |
|
|
4
|
|
|
|
|
24
|
|
|
135
|
|
|
|
|
|
|
} elsif ($self->{veryCompact} && ref $v |
|
136
|
|
|
|
|
|
|
&& (ref $v eq 'HASH') and !grep(ref $_, values %$v)) { |
|
137
|
3
|
|
|
|
|
66
|
my @a = sort keys %$v; |
|
138
|
3
|
|
|
|
|
7
|
my $depth = $#a; |
|
139
|
3
|
100
|
66
|
|
|
21
|
($shortmore, $depth) = (' ...', $self->{hashDepth} - 1) |
|
140
|
|
|
|
|
|
|
if $self->{hashDepth} and $depth >= $self->{hashDepth}; |
|
141
|
3
|
|
|
|
|
9
|
my @b = map {$self->stringify($_) . " => " . $self->stringify($$v{$_})} |
|
|
7
|
|
|
|
|
16
|
|
|
142
|
|
|
|
|
|
|
@a[0..$depth]; |
|
143
|
3
|
|
|
|
|
5
|
local $" = ', '; |
|
144
|
3
|
|
|
|
|
18
|
print "@b$shortmore\n"; |
|
145
|
|
|
|
|
|
|
} else { |
|
146
|
12
|
|
|
|
|
46
|
print "$short\n"; |
|
147
|
12
|
|
|
|
|
106
|
$self->unwrap($v,shift); |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
} |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub unwrap { |
|
152
|
28
|
|
|
28
|
0
|
42
|
my $self = shift; |
|
153
|
28
|
100
|
66
|
|
|
89
|
return if $DB::signal and $self->{stopDbSignal}; |
|
154
|
27
|
|
|
|
|
44
|
my ($v) = shift ; |
|
155
|
27
|
|
|
|
|
32
|
my ($s) = shift ; # extra no of spaces |
|
156
|
27
|
|
|
|
|
28
|
my $sp; |
|
157
|
27
|
|
|
|
|
43
|
my (%v,@v,$address,$short,$fileno); |
|
158
|
|
|
|
|
|
|
|
|
159
|
27
|
|
|
|
|
58
|
$sp = " " x $s ; |
|
160
|
27
|
|
|
|
|
30
|
$s += 3 ; |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
# Check for reused addresses |
|
163
|
27
|
100
|
|
|
|
77
|
if (ref $v) { |
|
|
|
100
|
|
|
|
|
|
|
164
|
16
|
|
|
|
|
24
|
my $val = $v; |
|
165
|
1
|
|
|
1
|
|
6
|
{ no strict 'refs'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
3489
|
|
|
|
16
|
|
|
|
|
17
|
|
|
166
|
16
|
|
|
|
|
68
|
$val = &{'overload::StrVal'}($v) |
|
|
16
|
|
|
|
|
82
|
|
|
167
|
16
|
50
|
33
|
|
|
43
|
if %overload:: and defined &{'overload::StrVal'}; |
|
168
|
|
|
|
|
|
|
} |
|
169
|
16
|
|
|
|
|
142
|
($address) = $val =~ /(0x[0-9a-f]+)\)$/ ; |
|
170
|
16
|
100
|
66
|
|
|
72
|
if (!$self->{dumpReused} && defined $address) { |
|
171
|
3
|
|
|
|
|
9
|
$address{$address}++ ; |
|
172
|
3
|
100
|
|
|
|
13
|
if ( $address{$address} > 1 ) { |
|
173
|
1
|
|
|
|
|
6
|
print "${sp}-> REUSED_ADDRESS\n" ; |
|
174
|
1
|
|
|
|
|
10
|
return ; |
|
175
|
|
|
|
|
|
|
} |
|
176
|
|
|
|
|
|
|
} |
|
177
|
|
|
|
|
|
|
} elsif (ref \$v eq 'GLOB') { |
|
178
|
2
|
|
|
|
|
9
|
$address = "$v" . ""; # To avoid a bug with globs |
|
179
|
2
|
|
|
|
|
6
|
$address{$address}++ ; |
|
180
|
2
|
100
|
|
|
|
9
|
if ( $address{$address} > 1 ) { |
|
181
|
1
|
|
|
|
|
6
|
print "${sp}*DUMPED_GLOB*\n" ; |
|
182
|
1
|
|
|
|
|
10
|
return ; |
|
183
|
|
|
|
|
|
|
} |
|
184
|
|
|
|
|
|
|
} |
|
185
|
|
|
|
|
|
|
|
|
186
|
25
|
100
|
|
|
|
75
|
if (ref $v eq 'Regexp') { |
|
187
|
1
|
|
|
|
|
3
|
my $re = "$v"; |
|
188
|
1
|
|
|
|
|
4
|
$re =~ s,/,\\/,g; |
|
189
|
1
|
|
|
|
|
6
|
print "$sp-> qr/$re/\n"; |
|
190
|
1
|
|
|
|
|
10
|
return; |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
|
|
193
|
24
|
100
|
66
|
|
|
249
|
if ( UNIVERSAL::isa($v, 'HASH') ) { |
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
194
|
4
|
|
|
|
|
111
|
my @sortKeys = sort keys(%$v) ; |
|
195
|
4
|
|
|
|
|
13
|
my $more; |
|
196
|
4
|
|
|
|
|
6
|
my $tHashDepth = $#sortKeys ; |
|
197
|
4
|
100
|
|
|
|
79
|
$tHashDepth = $#sortKeys < $self->{hashDepth}-1 ? $#sortKeys : $self->{hashDepth}-1 |
|
|
|
50
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
unless $self->{hashDepth} eq '' ; |
|
199
|
4
|
100
|
|
|
|
14
|
$more = "....\n" if $tHashDepth < $#sortKeys ; |
|
200
|
4
|
|
|
|
|
8
|
my $shortmore = ""; |
|
201
|
4
|
100
|
|
|
|
11
|
$shortmore = ", ..." if $tHashDepth < $#sortKeys ; |
|
202
|
4
|
|
|
|
|
18
|
$#sortKeys = $tHashDepth ; |
|
203
|
4
|
100
|
66
|
|
|
18
|
if ($self->{compactDump} && !grep(ref $_, values %{$v})) { |
|
|
2
|
|
|
|
|
36
|
|
|
204
|
2
|
|
|
|
|
4
|
$short = $sp; |
|
205
|
2
|
|
|
|
|
3
|
my @keys; |
|
206
|
2
|
|
|
|
|
6
|
for (@sortKeys) { |
|
207
|
4
|
|
|
|
|
11
|
push @keys, $self->stringify($_) . " => " . $self->stringify($v->{$_}); |
|
208
|
|
|
|
|
|
|
} |
|
209
|
2
|
|
|
|
|
7
|
$short .= join ', ', @keys; |
|
210
|
2
|
|
|
|
|
4
|
$short .= $shortmore; |
|
211
|
2
|
50
|
|
|
|
15
|
(print "$short\n"), return if length $short <= $self->{compactDump}; |
|
212
|
|
|
|
|
|
|
} |
|
213
|
2
|
|
|
|
|
6
|
for my $key (@sortKeys) { |
|
214
|
1
|
50
|
33
|
|
|
6
|
return if $DB::signal and $self->{stopDbSignal}; |
|
215
|
1
|
|
|
|
|
3
|
my $value = $ {$v}{$key} ; |
|
|
1
|
|
|
|
|
3
|
|
|
216
|
1
|
|
|
|
|
5
|
print $sp, $self->stringify($key), " => "; |
|
217
|
1
|
|
|
|
|
10
|
$self->DumpElem($value, $s); |
|
218
|
|
|
|
|
|
|
} |
|
219
|
2
|
100
|
|
|
|
11
|
print "$sp empty hash\n" unless @sortKeys; |
|
220
|
2
|
50
|
|
|
|
20
|
print "$sp$more" if defined $more ; |
|
221
|
|
|
|
|
|
|
} elsif ( UNIVERSAL::isa($v, 'ARRAY') ) { |
|
222
|
7
|
|
|
|
|
9
|
my $tArrayDepth = $#{$v} ; |
|
|
7
|
|
|
|
|
13
|
|
|
223
|
7
|
|
|
|
|
13
|
my $more ; |
|
224
|
7
|
100
|
|
|
|
36
|
$tArrayDepth = $#$v < $self->{arrayDepth}-1 ? $#$v : $self->{arrayDepth}-1 |
|
|
|
100
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
unless $self->{arrayDepth} eq '' ; |
|
226
|
7
|
100
|
|
|
|
12
|
$more = "....\n" if $tArrayDepth < $#{$v} ; |
|
|
7
|
|
|
|
|
18
|
|
|
227
|
7
|
|
|
|
|
12
|
my $shortmore = ""; |
|
228
|
7
|
100
|
|
|
|
8
|
$shortmore = " ..." if $tArrayDepth < $#{$v} ; |
|
|
7
|
|
|
|
|
16
|
|
|
229
|
7
|
100
|
100
|
|
|
25
|
if ($self->{compactDump} && !grep(ref $_, @{$v})) { |
|
|
4
|
|
|
|
|
21
|
|
|
230
|
3
|
50
|
|
|
|
9
|
if ($#$v >= 0) { |
|
231
|
3
|
50
|
|
|
|
15
|
$short = $sp . "0..$#{$v} " . |
|
|
6
|
|
|
|
|
22
|
|
|
232
|
|
|
|
|
|
|
join(" ", |
|
233
|
3
|
|
|
|
|
5
|
map {exists $v->[$_] ? $self->stringify($v->[$_]) : "empty"} (0..$tArrayDepth) |
|
234
|
|
|
|
|
|
|
) . "$shortmore"; |
|
235
|
|
|
|
|
|
|
} else { |
|
236
|
0
|
|
|
|
|
0
|
$short = $sp . "empty array"; |
|
237
|
|
|
|
|
|
|
} |
|
238
|
3
|
50
|
|
|
|
22
|
(print "$short\n"), return if length $short <= $self->{compactDump}; |
|
239
|
|
|
|
|
|
|
} |
|
240
|
4
|
|
|
|
|
12
|
for my $num (0 .. $tArrayDepth) { |
|
241
|
3
|
50
|
33
|
|
|
12
|
return if $DB::signal and $self->{stopDbSignal}; |
|
242
|
3
|
|
|
|
|
17
|
print "$sp$num "; |
|
243
|
3
|
50
|
|
|
|
22
|
if (exists $v->[$num]) { |
|
244
|
3
|
|
|
|
|
10
|
$self->DumpElem($v->[$num], $s); |
|
245
|
|
|
|
|
|
|
} else { |
|
246
|
0
|
|
|
|
|
0
|
print "empty slot\n"; |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
} |
|
249
|
4
|
100
|
|
|
|
24
|
print "$sp empty array\n" unless @$v; |
|
250
|
4
|
50
|
|
|
|
25
|
print "$sp$more" if defined $more ; |
|
251
|
|
|
|
|
|
|
} elsif ( UNIVERSAL::isa($v, 'SCALAR') or ref $v eq 'REF' ) { |
|
252
|
2
|
|
|
|
|
13
|
print "$sp-> "; |
|
253
|
2
|
|
|
|
|
18
|
$self->DumpElem($$v, $s); |
|
254
|
|
|
|
|
|
|
} elsif ( UNIVERSAL::isa($v, 'CODE') ) { |
|
255
|
1
|
|
|
|
|
8
|
print "$sp-> "; |
|
256
|
1
|
|
|
|
|
21
|
$self->dumpsub(0, $v); |
|
257
|
|
|
|
|
|
|
} elsif ( UNIVERSAL::isa($v, 'GLOB') ) { |
|
258
|
0
|
|
|
|
|
0
|
print "$sp-> ",$self->stringify($$v,1),"\n"; |
|
259
|
0
|
0
|
|
|
|
0
|
if ($self->{globPrint}) { |
|
|
|
0
|
|
|
|
|
|
|
260
|
0
|
|
|
|
|
0
|
$s += 3; |
|
261
|
0
|
|
|
|
|
0
|
$self->dumpglob('', $s, "{$$v}", $$v, 1); |
|
262
|
|
|
|
|
|
|
} elsif (defined ($fileno = fileno($v))) { |
|
263
|
0
|
|
|
|
|
0
|
print( (' ' x ($s+3)) . "FileHandle({$$v}) => fileno($fileno)\n" ); |
|
264
|
|
|
|
|
|
|
} |
|
265
|
|
|
|
|
|
|
} elsif (ref \$v eq 'GLOB') { |
|
266
|
1
|
50
|
|
|
|
4
|
if ($self->{globPrint}) { |
|
|
|
0
|
|
|
|
|
|
|
267
|
1
|
|
|
|
|
10
|
$self->dumpglob('', $s, "{$v}", $v, 1); |
|
268
|
|
|
|
|
|
|
} elsif (defined ($fileno = fileno(\$v))) { |
|
269
|
0
|
|
|
|
|
0
|
print( (' ' x $s) . "FileHandle({$v}) => fileno($fileno)\n" ); |
|
270
|
|
|
|
|
|
|
} |
|
271
|
|
|
|
|
|
|
} |
|
272
|
|
|
|
|
|
|
} |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
sub matchvar { |
|
275
|
0
|
|
|
|
|
0
|
$_[0] eq $_[1] or |
|
276
|
|
|
|
|
|
|
($_[1] =~ /^([!~])(.)([\x00-\xff]*)/) and |
|
277
|
521
|
100
|
33
|
521
|
0
|
6446
|
($1 eq '!') ^ (eval {($_[2] . "::" . $_[0]) =~ /$2$3/}); |
|
278
|
|
|
|
|
|
|
} |
|
279
|
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
sub compactDump { |
|
281
|
4
|
|
|
4
|
1
|
6
|
my $self = shift; |
|
282
|
4
|
100
|
|
|
|
15
|
$self->{compactDump} = shift if @_; |
|
283
|
4
|
100
|
66
|
|
|
22
|
$self->{compactDump} = 6*80-1 |
|
284
|
|
|
|
|
|
|
if $self->{compactDump} and $self->{compactDump} < 2; |
|
285
|
4
|
|
|
|
|
15
|
$self->{compactDump}; |
|
286
|
|
|
|
|
|
|
} |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
sub veryCompact { |
|
289
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
|
290
|
1
|
50
|
|
|
|
6
|
$self->{veryCompact} = shift if @_; |
|
291
|
1
|
50
|
33
|
|
|
11
|
$self->compactDump(1) if !$self->{compactDump} and $self->{veryCompact}; |
|
292
|
1
|
|
|
|
|
4
|
$self->{veryCompact}; |
|
293
|
|
|
|
|
|
|
} |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
sub set_unctrl { |
|
296
|
3
|
|
|
3
|
1
|
4
|
my $self = shift; |
|
297
|
3
|
100
|
|
|
|
9
|
if (@_) { |
|
298
|
2
|
|
|
|
|
4
|
my $in = shift; |
|
299
|
2
|
100
|
66
|
|
|
12
|
if ($in eq 'unctrl' or $in eq 'quote') { |
|
300
|
1
|
|
|
|
|
3
|
$self->{unctrl} = $in; |
|
301
|
|
|
|
|
|
|
} else { |
|
302
|
1
|
|
|
|
|
4
|
print "Unknown value for 'unctrl'.\n"; |
|
303
|
|
|
|
|
|
|
} |
|
304
|
|
|
|
|
|
|
} |
|
305
|
3
|
|
|
|
|
14
|
$self->{unctrl}; |
|
306
|
|
|
|
|
|
|
} |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
sub set_quote { |
|
309
|
3
|
|
|
3
|
1
|
8
|
my $self = shift; |
|
310
|
3
|
100
|
66
|
|
|
33
|
if (@_ and $_[0] eq '"') { |
|
|
|
100
|
66
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
311
|
1
|
|
|
|
|
3
|
$self->{tick} = '"'; |
|
312
|
1
|
|
|
|
|
3
|
$self->{unctrl} = 'quote'; |
|
313
|
|
|
|
|
|
|
} elsif (@_ and $_[0] eq 'auto') { |
|
314
|
1
|
|
|
|
|
2
|
$self->{tick} = 'auto'; |
|
315
|
1
|
|
|
|
|
2
|
$self->{unctrl} = 'quote'; |
|
316
|
|
|
|
|
|
|
} elsif (@_) { # Need to set |
|
317
|
1
|
|
|
|
|
2
|
$self->{tick} = "'"; |
|
318
|
1
|
|
|
|
|
2
|
$self->{unctrl} = 'unctrl'; |
|
319
|
|
|
|
|
|
|
} |
|
320
|
3
|
|
|
|
|
6
|
$self->{tick}; |
|
321
|
|
|
|
|
|
|
} |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
sub dumpglob { |
|
324
|
10
|
|
|
10
|
0
|
1664
|
my $self = shift; |
|
325
|
10
|
100
|
66
|
|
|
39
|
return if $DB::signal and $self->{stopDbSignal}; |
|
326
|
9
|
|
|
|
|
33
|
my ($package, $off, $key, $val, $all) = @_; |
|
327
|
9
|
|
|
|
|
17
|
local(*stab) = $val; |
|
328
|
9
|
|
|
|
|
13
|
my $fileno; |
|
329
|
9
|
100
|
66
|
|
|
66
|
if (($key !~ /^_ or $self->{dumpDBFiles}) and defined $stab) { |
|
|
|
|
66
|
|
|
|
|
|
330
|
2
|
|
|
|
|
10
|
print( (' ' x $off) . "\$", &unctrl($key), " = " ); |
|
331
|
2
|
|
|
|
|
17
|
$self->DumpElem($stab, 3+$off); |
|
332
|
|
|
|
|
|
|
} |
|
333
|
9
|
100
|
66
|
|
|
56
|
if (($key !~ /^_ or $self->{dumpDBFiles}) and @stab) { |
|
|
|
|
66
|
|
|
|
|
|
334
|
2
|
|
|
|
|
11
|
print( (' ' x $off) . "\@$key = (\n" ); |
|
335
|
2
|
|
|
|
|
17
|
$self->unwrap(\@stab,3+$off) ; |
|
336
|
2
|
|
|
|
|
18
|
print( (' ' x $off) . ")\n" ); |
|
337
|
|
|
|
|
|
|
} |
|
338
|
9
|
50
|
33
|
|
|
104
|
if ($key ne "main::" && $key ne "DB::" && %stab |
|
|
|
|
66
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
339
|
|
|
|
|
|
|
&& ($self->{dumpPackages} or $key !~ /::$/) |
|
340
|
|
|
|
|
|
|
&& ($key !~ /^_ or $self->{dumpDBFiles}) |
|
341
|
|
|
|
|
|
|
&& !($package eq "Dumpvalue" and $key eq "stab")) { |
|
342
|
2
|
|
|
|
|
10
|
print( (' ' x $off) . "\%$key = (\n" ); |
|
343
|
2
|
|
|
|
|
14
|
$self->unwrap(\%stab,3+$off) ; |
|
344
|
2
|
|
|
|
|
25
|
print( (' ' x $off) . ")\n" ); |
|
345
|
|
|
|
|
|
|
} |
|
346
|
9
|
100
|
|
|
|
35
|
if (defined ($fileno = fileno(*stab))) { |
|
347
|
1
|
|
|
|
|
7
|
print( (' ' x $off) . "FileHandle($key) => fileno($fileno)\n" ); |
|
348
|
|
|
|
|
|
|
} |
|
349
|
9
|
100
|
|
|
|
35
|
if ($all) { |
|
350
|
2
|
100
|
|
|
|
13
|
if (defined &stab) { |
|
351
|
1
|
|
|
|
|
5
|
$self->dumpsub($off, $key); |
|
352
|
|
|
|
|
|
|
} |
|
353
|
|
|
|
|
|
|
} |
|
354
|
|
|
|
|
|
|
} |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
sub CvGV_name { |
|
357
|
4
|
|
|
4
|
0
|
1255
|
my $self = shift; |
|
358
|
4
|
|
|
|
|
6
|
my $in = shift; |
|
359
|
4
|
50
|
|
|
|
17
|
return if $self->{skipCvGV}; # Backdoor to avoid problems if XS broken... |
|
360
|
4
|
|
|
|
|
9
|
$in = \&$in; # Hard reference... |
|
361
|
4
|
50
|
|
|
|
6
|
eval {require Devel::Peek; 1} or return; |
|
|
4
|
|
|
|
|
4324
|
|
|
|
4
|
|
|
|
|
563
|
|
|
362
|
4
|
50
|
|
|
|
24
|
my $gv = Devel::Peek::CvGV($in) or return; |
|
363
|
4
|
|
|
|
|
74
|
*$gv{PACKAGE} . '::' . *$gv{NAME}; |
|
364
|
|
|
|
|
|
|
} |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
sub dumpsub { |
|
367
|
4
|
|
|
4
|
0
|
567
|
my $self = shift; |
|
368
|
4
|
|
|
|
|
11
|
my ($off,$sub) = @_; |
|
369
|
4
|
|
|
|
|
6
|
my $ini = $sub; |
|
370
|
4
|
|
|
|
|
5
|
my $s; |
|
371
|
4
|
50
|
|
|
|
14
|
$sub = $1 if $sub =~ /^\{\*(.*)\}$/; |
|
372
|
4
|
50
|
|
|
|
24
|
my $subref = defined $1 ? \&$sub : \&$ini; |
|
373
|
4
|
|
33
|
|
|
38
|
my $place = $DB::sub{$sub} || (($s = $subs{"$subref"}) && $DB::sub{$s}) |
|
374
|
|
|
|
|
|
|
|| (($s = $self->CvGV_name($subref)) && $DB::sub{$s}) |
|
375
|
|
|
|
|
|
|
|| ($self->{subdump} && ($s = $self->findsubs("$subref")) |
|
376
|
|
|
|
|
|
|
&& $DB::sub{$s}); |
|
377
|
4
|
50
|
|
|
|
15
|
$s = $sub unless defined $s; |
|
378
|
4
|
100
|
|
|
|
12
|
$place = '???' unless defined $place; |
|
379
|
4
|
|
|
|
|
30
|
print( (' ' x $off) . "&$s in $place\n" ); |
|
380
|
|
|
|
|
|
|
} |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
sub findsubs { |
|
383
|
5
|
|
|
5
|
0
|
647
|
my $self = shift; |
|
384
|
5
|
100
|
|
|
|
26
|
return undef unless %DB::sub; |
|
385
|
1
|
|
|
|
|
2
|
my ($addr, $name, $loc); |
|
386
|
1
|
|
|
|
|
6
|
while (($name, $loc) = each %DB::sub) { |
|
387
|
1
|
|
|
|
|
4
|
$addr = \&$name; |
|
388
|
1
|
|
|
|
|
6
|
$subs{"$addr"} = $name; |
|
389
|
|
|
|
|
|
|
} |
|
390
|
1
|
|
|
|
|
2
|
$self->{subdump} = 0; |
|
391
|
1
|
|
|
|
|
6
|
$subs{ shift() }; |
|
392
|
|
|
|
|
|
|
} |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
sub dumpvars { |
|
395
|
3
|
|
|
3
|
1
|
6
|
my $self = shift; |
|
396
|
3
|
|
|
|
|
9
|
my ($package,@vars) = @_; |
|
397
|
3
|
|
|
|
|
13
|
local(%address,$^W); |
|
398
|
3
|
|
|
|
|
6
|
my ($key,$val); |
|
399
|
3
|
50
|
|
|
|
12
|
$package .= "::" unless $package =~ /::$/; |
|
400
|
3
|
|
|
|
|
8
|
*stab = *main::; |
|
401
|
|
|
|
|
|
|
|
|
402
|
3
|
|
|
|
|
23
|
while ($package =~ /(\w+?::)/g) { |
|
403
|
3
|
|
|
|
|
15
|
*stab = $ {stab}{$1}; |
|
404
|
|
|
|
|
|
|
} |
|
405
|
3
|
|
|
|
|
6
|
$self->{TotalStrings} = 0; |
|
406
|
3
|
|
|
|
|
6
|
$self->{Strings} = 0; |
|
407
|
3
|
|
|
|
|
6
|
$self->{CompleteTotal} = 0; |
|
408
|
3
|
|
|
|
|
15
|
while (($key,$val) = each(%stab)) { |
|
409
|
519
|
100
|
66
|
|
|
2245
|
return if $DB::signal and $self->{stopDbSignal}; |
|
410
|
518
|
100
|
66
|
|
|
1645
|
next if @vars && !grep( matchvar($key, $_), @vars ); |
|
411
|
1
|
50
|
|
|
|
5
|
if ($self->{usageOnly}) { |
|
412
|
0
|
0
|
0
|
|
|
0
|
$self->globUsage(\$val, $key) |
|
|
|
|
0
|
|
|
|
|
|
413
|
|
|
|
|
|
|
if ($package ne 'Dumpvalue' or $key ne 'stab') |
|
414
|
|
|
|
|
|
|
and ref(\$val) eq 'GLOB'; |
|
415
|
|
|
|
|
|
|
} else { |
|
416
|
1
|
|
|
|
|
6
|
$self->dumpglob($package, 0,$key, $val); |
|
417
|
|
|
|
|
|
|
} |
|
418
|
|
|
|
|
|
|
} |
|
419
|
2
|
100
|
|
|
|
20
|
if ($self->{usageOnly}) { |
|
420
|
1
|
|
|
|
|
10
|
print <
|
|
421
|
|
|
|
|
|
|
String space: $self->{TotalStrings} bytes in $self->{Strings} strings. |
|
422
|
|
|
|
|
|
|
EOP |
|
423
|
1
|
|
|
|
|
9
|
$self->{CompleteTotal} += $self->{TotalStrings}; |
|
424
|
1
|
|
|
|
|
6
|
print <
|
|
425
|
|
|
|
|
|
|
Grand total = $self->{CompleteTotal} bytes (1 level deep) + overhead. |
|
426
|
|
|
|
|
|
|
EOP |
|
427
|
|
|
|
|
|
|
} |
|
428
|
|
|
|
|
|
|
} |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
sub scalarUsage { |
|
431
|
15
|
|
|
15
|
0
|
19
|
my $self = shift; |
|
432
|
15
|
|
|
|
|
18
|
my $size; |
|
433
|
15
|
100
|
|
|
|
92
|
if (UNIVERSAL::isa($_[0], 'ARRAY')) { |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
434
|
1
|
|
|
|
|
6
|
$size = $self->arrayUsage($_[0]); |
|
435
|
|
|
|
|
|
|
} elsif (UNIVERSAL::isa($_[0], 'HASH')) { |
|
436
|
0
|
|
|
|
|
0
|
$size = $self->hashUsage($_[0]); |
|
437
|
|
|
|
|
|
|
} elsif (!ref($_[0])) { |
|
438
|
14
|
|
|
|
|
20
|
$size = length($_[0]); |
|
439
|
|
|
|
|
|
|
} |
|
440
|
15
|
|
|
|
|
23
|
$self->{TotalStrings} += $size; |
|
441
|
15
|
|
|
|
|
18
|
$self->{Strings}++; |
|
442
|
15
|
|
|
|
|
41
|
$size; |
|
443
|
|
|
|
|
|
|
} |
|
444
|
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
sub arrayUsage { # array ref, name |
|
446
|
9
|
|
|
9
|
0
|
12
|
my $self = shift; |
|
447
|
9
|
|
|
|
|
11
|
my $size = 0; |
|
448
|
9
|
|
|
|
|
11
|
map {$size += $self->scalarUsage($_)} @{$_[0]}; |
|
|
13
|
|
|
|
|
26
|
|
|
|
9
|
|
|
|
|
16
|
|
|
449
|
9
|
|
|
|
|
11
|
my $len = @{$_[0]}; |
|
|
9
|
|
|
|
|
15
|
|
|
450
|
9
|
100
|
|
|
|
36
|
print "\@$_[1] = $len item", ($len > 1 ? "s" : ""), " (data: $size bytes)\n" |
|
|
|
100
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
if defined $_[1]; |
|
452
|
9
|
|
|
|
|
21
|
$self->{CompleteTotal} += $size; |
|
453
|
9
|
|
|
|
|
19
|
$size; |
|
454
|
|
|
|
|
|
|
} |
|
455
|
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
sub hashUsage { # hash ref, name |
|
457
|
3
|
|
|
3
|
0
|
7
|
my $self = shift; |
|
458
|
3
|
|
|
|
|
7
|
my @keys = keys %{$_[0]}; |
|
|
3
|
|
|
|
|
10
|
|
|
459
|
3
|
|
|
|
|
6
|
my @values = values %{$_[0]}; |
|
|
3
|
|
|
|
|
9
|
|
|
460
|
3
|
|
|
|
|
7
|
my $keys = $self->arrayUsage(\@keys); |
|
461
|
3
|
|
|
|
|
9
|
my $values = $self->arrayUsage(\@values); |
|
462
|
3
|
|
|
|
|
5
|
my $len = @keys; |
|
463
|
3
|
|
|
|
|
4
|
my $total = $keys + $values; |
|
464
|
3
|
50
|
|
|
|
29
|
print "\%$_[1] = $len item", ($len > 1 ? "s" : ""), |
|
|
|
50
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
" (keys: $keys; values: $values; total: $total bytes)\n" |
|
466
|
|
|
|
|
|
|
if defined $_[1]; |
|
467
|
3
|
|
|
|
|
24
|
$total; |
|
468
|
|
|
|
|
|
|
} |
|
469
|
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
sub globUsage { # glob ref, name |
|
471
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
|
472
|
1
|
|
|
|
|
3
|
local *stab = *{$_[0]}; |
|
|
1
|
|
|
|
|
3
|
|
|
473
|
1
|
|
|
|
|
2
|
my $total = 0; |
|
474
|
1
|
50
|
|
|
|
6
|
$total += $self->scalarUsage($stab) if defined $stab; |
|
475
|
1
|
50
|
|
|
|
8
|
$total += $self->arrayUsage(\@stab, $_[1]) if @stab; |
|
476
|
1
|
50
|
33
|
|
|
28
|
$total += $self->hashUsage(\%stab, $_[1]) |
|
|
|
|
33
|
|
|
|
|
|
477
|
|
|
|
|
|
|
if %stab and $_[1] ne "main::" and $_[1] ne "DB::"; |
|
478
|
|
|
|
|
|
|
#and !($package eq "Dumpvalue" and $key eq "stab")); |
|
479
|
1
|
|
|
|
|
5
|
$total; |
|
480
|
|
|
|
|
|
|
} |
|
481
|
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
1; |
|
483
|
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
=head1 NAME |
|
485
|
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
Dumpvalue - provides screen dump of Perl data. |
|
487
|
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
489
|
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
use Dumpvalue; |
|
491
|
|
|
|
|
|
|
my $dumper = Dumpvalue->new; |
|
492
|
|
|
|
|
|
|
$dumper->set(globPrint => 1); |
|
493
|
|
|
|
|
|
|
$dumper->dumpValue(\*::); |
|
494
|
|
|
|
|
|
|
$dumper->dumpvars('main'); |
|
495
|
|
|
|
|
|
|
my $dump = $dumper->stringify($some_value); |
|
496
|
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
498
|
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
=head2 Creation |
|
500
|
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
A new dumper is created by a call |
|
502
|
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
$d = Dumpvalue->new(option1 => value1, option2 => value2) |
|
504
|
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
Recognized options: |
|
506
|
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
=over 4 |
|
508
|
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
=item C, C |
|
510
|
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
Print only first N elements of arrays and hashes. If false, prints all the |
|
512
|
|
|
|
|
|
|
elements. |
|
513
|
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
=item C, C |
|
515
|
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
Change style of array and hash dump. If true, short array |
|
517
|
|
|
|
|
|
|
may be printed on one line. |
|
518
|
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
=item C |
|
520
|
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
Whether to print contents of globs. |
|
522
|
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
=item C |
|
524
|
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
Dump arrays holding contents of debugged files. |
|
526
|
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
=item C |
|
528
|
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
Dump symbol tables of packages. |
|
530
|
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
=item C |
|
532
|
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
Dump contents of "reused" addresses. |
|
534
|
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
=item C, C, C |
|
536
|
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
Change style of string dump. Default value of C is C, one |
|
538
|
|
|
|
|
|
|
can enable either double-quotish dump, or single-quotish by setting it |
|
539
|
|
|
|
|
|
|
to C<"> or C<'>. By default, characters with high bit set are printed |
|
540
|
|
|
|
|
|
|
I. If C is set, they will be quoted. |
|
541
|
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
=item C |
|
543
|
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
rudimentary per-package memory usage dump. If set, |
|
545
|
|
|
|
|
|
|
C calculates total size of strings in variables in the package. |
|
546
|
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
=item unctrl |
|
548
|
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
Changes the style of printout of strings. Possible values are |
|
550
|
|
|
|
|
|
|
C and C. |
|
551
|
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
=item subdump |
|
553
|
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
Whether to try to find the subroutine name given the reference. |
|
555
|
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
=item bareStringify |
|
557
|
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
Whether to write the non-overloaded form of the stringify-overloaded objects. |
|
559
|
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
=item quoteHighBit |
|
561
|
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
Whether to print chars with high bit set in binary or "as is". |
|
563
|
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
=item stopDbSignal |
|
565
|
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
Whether to abort printing if debugger signal flag is raised. |
|
567
|
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
=back |
|
569
|
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
Later in the life of the object the methods may be queries with get() |
|
571
|
|
|
|
|
|
|
method and set() method (which accept multiple arguments). |
|
572
|
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
=head2 Methods |
|
574
|
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
=over 4 |
|
576
|
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
=item dumpValue |
|
578
|
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
$dumper->dumpValue($value); |
|
580
|
|
|
|
|
|
|
$dumper->dumpValue([$value1, $value2]); |
|
581
|
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
Prints a dump to the currently selected filehandle. |
|
583
|
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
=item dumpValues |
|
585
|
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
$dumper->dumpValues($value1, $value2); |
|
587
|
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
Same as C<< $dumper->dumpValue([$value1, $value2]); >>. |
|
589
|
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
=item stringify |
|
591
|
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
my $dump = $dumper->stringify($value [,$noticks] ); |
|
593
|
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
Returns the dump of a single scalar without printing. If the second |
|
595
|
|
|
|
|
|
|
argument is true, the return value does not contain enclosing ticks. |
|
596
|
|
|
|
|
|
|
Does not handle data structures. |
|
597
|
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
=item dumpvars |
|
599
|
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
$dumper->dumpvars('my_package'); |
|
601
|
|
|
|
|
|
|
$dumper->dumpvars('my_package', 'foo', '~bar$', '!......'); |
|
602
|
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
The optional arguments are considered as literal strings unless they |
|
604
|
|
|
|
|
|
|
start with C<~> or C, in which case they are interpreted as regular |
|
605
|
|
|
|
|
|
|
expressions (possibly negated). |
|
606
|
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
The second example prints entries with names C, and also entries |
|
608
|
|
|
|
|
|
|
with names which ends on C, or are shorter than 5 chars. |
|
609
|
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
=item set_quote |
|
611
|
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
$d->set_quote('"'); |
|
613
|
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
Sets C and C options to suitable values for printout with the |
|
615
|
|
|
|
|
|
|
given quote char. Possible values are C, C<'> and C<">. |
|
616
|
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
=item set_unctrl |
|
618
|
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
$d->set_unctrl('unctrl'); |
|
620
|
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
Sets C option with checking for an invalid argument. |
|
622
|
|
|
|
|
|
|
Possible values are C and C. |
|
623
|
|
|
|
|
|
|
|
|
624
|
|
|
|
|
|
|
=item compactDump |
|
625
|
|
|
|
|
|
|
|
|
626
|
|
|
|
|
|
|
$d->compactDump(1); |
|
627
|
|
|
|
|
|
|
|
|
628
|
|
|
|
|
|
|
Sets C option. If the value is 1, sets to a reasonable |
|
629
|
|
|
|
|
|
|
big number. |
|
630
|
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
=item veryCompact |
|
632
|
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
$d->veryCompact(1); |
|
634
|
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
Sets C and C options simultaneously. |
|
636
|
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
=item set |
|
638
|
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
$d->set(option1 => value1, option2 => value2); |
|
640
|
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
=item get |
|
642
|
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
@values = $d->get('option1', 'option2'); |
|
644
|
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
=back |
|
646
|
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
=cut |
|
648
|
|
|
|
|
|
|
|