line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Native::Attribute::ReadOnlyArray; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
30933
|
use Carp; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
137
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
92
|
|
5
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1065
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
15
|
|
|
15
|
0
|
7086
|
my $old = shift; |
9
|
15
|
50
|
0
|
|
|
42
|
$old = tied ( @$old ) // $old if ref $old; |
10
|
15
|
|
33
|
|
|
59
|
my $class = ref $old || $old; |
11
|
15
|
|
50
|
|
|
39
|
my $self = shift || []; |
12
|
|
|
|
|
|
|
|
13
|
15
|
|
|
|
|
20
|
my $array; |
14
|
15
|
|
|
|
|
58
|
tie @$array, $class, $self; |
15
|
15
|
|
|
|
|
32
|
bless $array, $class; |
16
|
15
|
|
|
|
|
48
|
return $array; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub TIEARRAY { |
20
|
15
|
|
|
15
|
|
22
|
my $old = shift; |
21
|
15
|
|
33
|
|
|
52
|
my $class = ref $old || $old; |
22
|
15
|
|
50
|
|
|
32
|
my $data = shift || []; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Do not bless the reference that is passed in; the whole point is |
25
|
|
|
|
|
|
|
# not to modify the underlying data |
26
|
15
|
|
|
|
|
18
|
my $self = \$data; |
27
|
15
|
|
|
|
|
38
|
bless $self, $class; |
28
|
|
|
|
|
|
|
|
29
|
15
|
|
|
|
|
36
|
return $self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub FETCH { |
33
|
2
|
|
|
2
|
|
370
|
my $self = shift; |
34
|
2
|
|
|
|
|
3
|
my $index = shift; |
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
|
|
7
|
return $$self->[$index]; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub STORE { |
40
|
3
|
|
|
3
|
|
1455
|
my $self = shift; |
41
|
3
|
|
|
|
|
4
|
my $index = shift; |
42
|
3
|
|
|
|
|
4
|
my $value = shift; |
43
|
|
|
|
|
|
|
|
44
|
3
|
|
|
|
|
32
|
croak "Cannot modify read-only array"; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub FETCHSIZE { |
48
|
1
|
|
|
1
|
|
6
|
my $self = shift; |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
4
|
return scalar @$$self; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub STORESIZE { |
54
|
1
|
|
|
1
|
|
662
|
my $self = shift; |
55
|
1
|
|
|
|
|
2
|
my $count = shift; |
56
|
|
|
|
|
|
|
|
57
|
1
|
|
|
|
|
10
|
croak "Cannot modify read-only array"; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub EXTEND { |
61
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
62
|
0
|
|
|
|
|
0
|
my $count = shift; |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
0
|
croak "Cannot modify read-only array"; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub EXISTS { |
68
|
3
|
|
|
3
|
|
11
|
my $self = shift; |
69
|
3
|
|
|
|
|
4
|
my $index = shift; |
70
|
|
|
|
|
|
|
|
71
|
3
|
|
|
|
|
16
|
return exists $$self->[$index]; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub DELETE { |
75
|
1
|
|
|
1
|
|
34
|
my $self = shift; |
76
|
1
|
|
|
|
|
3
|
my $index = shift; |
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
12
|
croak "Cannot modify read-only array"; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub CLEAR { |
82
|
2
|
|
|
2
|
|
51
|
my $self = shift; |
83
|
|
|
|
|
|
|
|
84
|
2
|
|
|
|
|
18
|
croak "Cannot modify read-only array"; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub PUSH { |
88
|
1
|
|
|
1
|
|
25
|
my $self = shift; |
89
|
1
|
|
|
|
|
2
|
my @list = @_; |
90
|
|
|
|
|
|
|
|
91
|
1
|
|
|
|
|
9
|
croak "Cannot modify read-only array"; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub POP { |
95
|
1
|
|
|
1
|
|
30
|
my $self = shift; |
96
|
|
|
|
|
|
|
|
97
|
1
|
|
|
|
|
11
|
croak "Cannot modify read-only array"; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub SHIFT { |
101
|
2
|
|
|
2
|
|
27
|
my $self = shift; |
102
|
|
|
|
|
|
|
|
103
|
2
|
|
|
|
|
22
|
croak "Cannot modify read-only array"; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub UNSHIFT { |
107
|
1
|
|
|
1
|
|
34
|
my $self = shift; |
108
|
1
|
|
|
|
|
2
|
my @list = @_; |
109
|
|
|
|
|
|
|
|
110
|
1
|
|
|
|
|
13
|
croak "Cannot modify read-only array"; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub SPLICE { |
114
|
1
|
|
|
1
|
|
33
|
my $self = shift; |
115
|
1
|
|
|
|
|
2
|
my $offset = shift; |
116
|
1
|
|
|
|
|
1
|
my $length = shift; |
117
|
1
|
|
|
|
|
17
|
my @list = @_; |
118
|
|
|
|
|
|
|
|
119
|
1
|
|
|
|
|
10
|
croak "Cannot modify read-only array"; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
1; |