line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/env perl |
2
|
1
|
|
|
1
|
|
542
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
197
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
my %tests = ( |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
hash => [ |
8
|
|
|
|
|
|
|
<<'EOM', |
9
|
|
|
|
|
|
|
{ |
10
|
|
|
|
|
|
|
U => 2, |
11
|
|
|
|
|
|
|
B => 52, |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
EOM |
14
|
|
|
|
|
|
|
<<'EOM', |
15
|
|
|
|
|
|
|
--- |
16
|
|
|
|
|
|
|
- &1 !perl/hash |
17
|
|
|
|
|
|
|
B: 52 |
18
|
|
|
|
|
|
|
U: 2 |
19
|
|
|
|
|
|
|
- *1 |
20
|
|
|
|
|
|
|
EOM |
21
|
|
|
|
|
|
|
{ load_only => 1 }, |
22
|
|
|
|
|
|
|
], |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
hash_blessed => [ |
25
|
|
|
|
|
|
|
<<'EOM', |
26
|
|
|
|
|
|
|
bless { |
27
|
|
|
|
|
|
|
U => 2, |
28
|
|
|
|
|
|
|
B => 52, |
29
|
|
|
|
|
|
|
}, 'A::Very::Exclusive::Class' |
30
|
|
|
|
|
|
|
EOM |
31
|
|
|
|
|
|
|
<<'EOM', |
32
|
|
|
|
|
|
|
--- |
33
|
|
|
|
|
|
|
- &1 !perl/hash:A::Very::Exclusive::Class |
34
|
|
|
|
|
|
|
B: 52 |
35
|
|
|
|
|
|
|
U: 2 |
36
|
|
|
|
|
|
|
- *1 |
37
|
|
|
|
|
|
|
EOM |
38
|
|
|
|
|
|
|
], |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
array => [ |
41
|
|
|
|
|
|
|
<<'EOM', |
42
|
|
|
|
|
|
|
[ |
43
|
|
|
|
|
|
|
qw/ one two three four / |
44
|
|
|
|
|
|
|
] |
45
|
|
|
|
|
|
|
EOM |
46
|
|
|
|
|
|
|
<<'EOM', |
47
|
|
|
|
|
|
|
--- |
48
|
|
|
|
|
|
|
- &1 !perl/array |
49
|
|
|
|
|
|
|
- one |
50
|
|
|
|
|
|
|
- two |
51
|
|
|
|
|
|
|
- three |
52
|
|
|
|
|
|
|
- four |
53
|
|
|
|
|
|
|
- *1 |
54
|
|
|
|
|
|
|
EOM |
55
|
|
|
|
|
|
|
{ load_only => 1 }, |
56
|
|
|
|
|
|
|
], |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
array_blessed => [ |
59
|
|
|
|
|
|
|
<<'EOM', |
60
|
|
|
|
|
|
|
bless [ |
61
|
|
|
|
|
|
|
qw/ one two three four / |
62
|
|
|
|
|
|
|
], "Just::An::Arrayref" |
63
|
|
|
|
|
|
|
EOM |
64
|
|
|
|
|
|
|
<<'EOM', |
65
|
|
|
|
|
|
|
--- |
66
|
|
|
|
|
|
|
- &1 !perl/array:Just::An::Arrayref |
67
|
|
|
|
|
|
|
- one |
68
|
|
|
|
|
|
|
- two |
69
|
|
|
|
|
|
|
- three |
70
|
|
|
|
|
|
|
- four |
71
|
|
|
|
|
|
|
- *1 |
72
|
|
|
|
|
|
|
EOM |
73
|
|
|
|
|
|
|
], |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
regexp => [ |
76
|
|
|
|
|
|
|
<<'EOM', |
77
|
|
|
|
|
|
|
my $string = 'unblessed'; |
78
|
|
|
|
|
|
|
qr{$string} |
79
|
|
|
|
|
|
|
EOM |
80
|
|
|
|
|
|
|
<<"EOM", |
81
|
|
|
|
|
|
|
--- |
82
|
|
|
|
|
|
|
- &1 !perl/regexp unblessed |
83
|
|
|
|
|
|
|
- *1 |
84
|
|
|
|
|
|
|
EOM |
85
|
|
|
|
|
|
|
], |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
regexp_blessed => [ |
88
|
|
|
|
|
|
|
<<'EOM', |
89
|
|
|
|
|
|
|
my $string = 'blessed'; |
90
|
|
|
|
|
|
|
bless qr{$string}, "Foo" |
91
|
|
|
|
|
|
|
EOM |
92
|
|
|
|
|
|
|
<<"EOM", |
93
|
|
|
|
|
|
|
--- |
94
|
|
|
|
|
|
|
- &1 !perl/regexp:Foo blessed |
95
|
|
|
|
|
|
|
- *1 |
96
|
|
|
|
|
|
|
EOM |
97
|
|
|
|
|
|
|
], |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
circular => [ |
100
|
|
|
|
|
|
|
<<'EOM', |
101
|
|
|
|
|
|
|
my $circle = bless [ 1, 2 ], 'Circle'; |
102
|
|
|
|
|
|
|
push @$circle, $circle; |
103
|
|
|
|
|
|
|
$circle; |
104
|
|
|
|
|
|
|
EOM |
105
|
|
|
|
|
|
|
<<'EOM', |
106
|
|
|
|
|
|
|
--- |
107
|
|
|
|
|
|
|
- &1 !perl/array:Circle |
108
|
|
|
|
|
|
|
- 1 |
109
|
|
|
|
|
|
|
- 2 |
110
|
|
|
|
|
|
|
- *1 |
111
|
|
|
|
|
|
|
- *1 |
112
|
|
|
|
|
|
|
EOM |
113
|
|
|
|
|
|
|
], |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
coderef => [ |
116
|
|
|
|
|
|
|
<<'EOM', |
117
|
|
|
|
|
|
|
sub { |
118
|
|
|
|
|
|
|
my (%args) = @_; |
119
|
|
|
|
|
|
|
return $args{x} + $args{y}; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
EOM |
122
|
|
|
|
|
|
|
qr{- &1 !{1,2}perl/code \|-.*return.*args.*x.*\+.*y}s, |
123
|
|
|
|
|
|
|
{ load_code => 1 }, |
124
|
|
|
|
|
|
|
], |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
coderef_blessed => [ |
127
|
|
|
|
|
|
|
<<'EOM', |
128
|
|
|
|
|
|
|
bless sub { |
129
|
|
|
|
|
|
|
my (%args) = @_; |
130
|
|
|
|
|
|
|
return $args{x} - $args{y}; |
131
|
|
|
|
|
|
|
}, "I::Am::Code" |
132
|
|
|
|
|
|
|
EOM |
133
|
|
|
|
|
|
|
qr{- &1 !{1,2}perl/code:I::Am::Code \|-.*return.*args.*x.*\-.*y}s, |
134
|
|
|
|
|
|
|
{ load_code => 1 }, |
135
|
|
|
|
|
|
|
], |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
scalarref => [ |
138
|
|
|
|
|
|
|
<<'EOM', |
139
|
|
|
|
|
|
|
my $scalar = "some string"; |
140
|
|
|
|
|
|
|
my $scalarref = \$scalar; |
141
|
|
|
|
|
|
|
$scalarref; |
142
|
|
|
|
|
|
|
EOM |
143
|
|
|
|
|
|
|
<<'EOM', |
144
|
|
|
|
|
|
|
--- |
145
|
|
|
|
|
|
|
- &1 !perl/scalar |
146
|
|
|
|
|
|
|
=: some string |
147
|
|
|
|
|
|
|
- *1 |
148
|
|
|
|
|
|
|
EOM |
149
|
|
|
|
|
|
|
], |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
scalarref_blessed => [ |
152
|
|
|
|
|
|
|
<<'EOM', |
153
|
|
|
|
|
|
|
my $scalar = "some other string"; |
154
|
|
|
|
|
|
|
my $scalarref = bless \$scalar, 'Foo'; |
155
|
|
|
|
|
|
|
$scalarref; |
156
|
|
|
|
|
|
|
EOM |
157
|
|
|
|
|
|
|
<<'EOM', |
158
|
|
|
|
|
|
|
--- |
159
|
|
|
|
|
|
|
- &1 !perl/scalar:Foo |
160
|
|
|
|
|
|
|
=: some other string |
161
|
|
|
|
|
|
|
- *1 |
162
|
|
|
|
|
|
|
EOM |
163
|
|
|
|
|
|
|
], |
164
|
|
|
|
|
|
|
refref => [ |
165
|
|
|
|
|
|
|
<<'EOM', |
166
|
|
|
|
|
|
|
my $ref = { a => 'hash' }; |
167
|
|
|
|
|
|
|
my $refref = \$ref; |
168
|
|
|
|
|
|
|
$refref; |
169
|
|
|
|
|
|
|
EOM |
170
|
|
|
|
|
|
|
<<'EOM', |
171
|
|
|
|
|
|
|
--- |
172
|
|
|
|
|
|
|
- &1 !perl/ref |
173
|
|
|
|
|
|
|
=: |
174
|
|
|
|
|
|
|
a: hash |
175
|
|
|
|
|
|
|
- *1 |
176
|
|
|
|
|
|
|
EOM |
177
|
|
|
|
|
|
|
], |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
refref_blessed => [ |
180
|
|
|
|
|
|
|
<<'EOM', |
181
|
|
|
|
|
|
|
my $ref = { a => 'hash' }; |
182
|
|
|
|
|
|
|
my $refref = bless \$ref, 'Foo'; |
183
|
|
|
|
|
|
|
$refref; |
184
|
|
|
|
|
|
|
EOM |
185
|
|
|
|
|
|
|
<<'EOM', |
186
|
|
|
|
|
|
|
--- |
187
|
|
|
|
|
|
|
- &1 !perl/ref:Foo |
188
|
|
|
|
|
|
|
=: |
189
|
|
|
|
|
|
|
a: hash |
190
|
|
|
|
|
|
|
- *1 |
191
|
|
|
|
|
|
|
EOM |
192
|
|
|
|
|
|
|
], |
193
|
|
|
|
|
|
|
); |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
\%tests; |