line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Printer::Filter::REF; |
2
|
32
|
|
|
32
|
|
192
|
use strict; |
|
32
|
|
|
|
|
51
|
|
|
32
|
|
|
|
|
807
|
|
3
|
32
|
|
|
32
|
|
160
|
use warnings; |
|
32
|
|
|
|
|
52
|
|
|
32
|
|
|
|
|
650
|
|
4
|
32
|
|
|
32
|
|
146
|
use Data::Printer::Filter; |
|
32
|
|
|
|
|
56
|
|
|
32
|
|
|
|
|
176
|
|
5
|
32
|
|
|
32
|
|
179
|
use Scalar::Util (); |
|
32
|
|
|
|
|
78
|
|
|
32
|
|
|
|
|
4765
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
filter 'REF' => \&parse; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub parse { |
10
|
65
|
|
|
65
|
0
|
135
|
my ($ref, $ddp) = @_; |
11
|
|
|
|
|
|
|
|
12
|
65
|
|
|
|
|
110
|
my $string = ''; |
13
|
|
|
|
|
|
|
# we only add the '\' if it's not an object |
14
|
65
|
100
|
66
|
|
|
568
|
if (!Scalar::Util::blessed($$ref) && (ref $$ref eq 'REF' || ref $$ref eq 'SCALAR' || ref $$ref eq 'VSTRING')) { |
|
|
|
66
|
|
|
|
|
15
|
24
|
|
|
|
|
53
|
$string .= '\\ '; |
16
|
|
|
|
|
|
|
} |
17
|
65
|
|
|
|
|
253
|
$string .= $ddp->parse($$ref); |
18
|
|
|
|
|
|
|
|
19
|
65
|
50
|
66
|
|
|
178
|
if ($ddp->show_tied and my $tie = ref tied $ref) { |
20
|
0
|
|
|
|
|
0
|
$string .= " (tied to $tie)"; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
65
|
|
|
|
|
215
|
return $string; |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |