line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1241
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
63
|
|
2
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1381
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Manip::END; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
10
|
|
|
|
|
|
|
clear_end_array |
11
|
|
|
|
|
|
|
set_end_array |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
require XSLoader; |
17
|
|
|
|
|
|
|
XSLoader::load('Manip::END', $Manip::END::VERSION); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $self = bless get_end_array(), __PACKAGE__; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub set_end_array |
22
|
|
|
|
|
|
|
{ |
23
|
0
|
|
|
0
|
0
|
0
|
_check(@_); |
24
|
0
|
|
|
|
|
0
|
@$self = @_; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub clear_end_array |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
0
|
0
|
0
|
@$self = (); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub new |
33
|
|
|
|
|
|
|
{ |
34
|
2
|
|
|
2
|
0
|
26
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub clear |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
0
|
0
|
@$self = (); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub push |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
|
|
0
|
0
|
0
|
shift; |
45
|
0
|
|
|
|
|
0
|
_check(@_); |
46
|
0
|
|
|
|
|
0
|
push(@$self, @_); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub unshift |
50
|
|
|
|
|
|
|
{ |
51
|
3
|
|
|
3
|
0
|
89
|
shift; |
52
|
3
|
|
|
|
|
16
|
_check(@_); |
53
|
3
|
|
|
|
|
117
|
unshift(@$self, @_); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub filter_sub |
57
|
|
|
|
|
|
|
{ |
58
|
2
|
|
|
2
|
0
|
14
|
shift; |
59
|
2
|
|
|
|
|
4
|
my $sub = shift; |
60
|
|
|
|
|
|
|
|
61
|
2
|
|
|
|
|
3
|
my $max = $#$self; |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
|
|
8
|
for (my $i = 0; $i <= $max; $i++) |
64
|
|
|
|
|
|
|
{ |
65
|
11
|
100
|
|
|
|
70
|
if ( ! &$sub(get_pkg_for_index($i)) ) |
66
|
|
|
|
|
|
|
{ |
67
|
1
|
|
|
|
|
3
|
splice(@$self, $i, 1); |
68
|
1
|
|
|
|
|
6
|
$max--; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub remove_class |
74
|
|
|
|
|
|
|
{ |
75
|
0
|
|
|
0
|
0
|
0
|
shift; |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
0
|
my $class = shift; |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
0
|
|
0
|
$self->filter_sub(sub { ref($_[0]) ne $class } ); |
|
0
|
|
|
|
|
0
|
|
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub remove_isa |
83
|
|
|
|
|
|
|
{ |
84
|
1
|
|
|
1
|
0
|
37
|
shift; |
85
|
|
|
|
|
|
|
|
86
|
1
|
|
|
|
|
2
|
my $class = shift; |
87
|
|
|
|
|
|
|
|
88
|
1
|
|
|
5
|
|
6
|
$self->filter_sub(sub { ! UNIVERSAL::isa($_[0], $class) } ); |
|
5
|
|
|
|
|
156
|
|
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub remove_pat |
92
|
|
|
|
|
|
|
{ |
93
|
0
|
|
|
0
|
0
|
0
|
shift; |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
0
|
my $pat = shift; |
96
|
|
|
|
|
|
|
|
97
|
0
|
0
|
|
|
|
0
|
$pat = ref($_) ? $_ : qr/$pat/; |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
0
|
|
0
|
$self->filter_sub(sub { ! ($_[0] =~ $pat) } ); |
|
0
|
|
|
|
|
0
|
|
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub _check |
103
|
|
|
|
|
|
|
{ |
104
|
3
|
50
|
|
3
|
|
8
|
if (grep {! UNIVERSAL::isa($_, "CODE") } @_) |
|
3
|
|
|
|
|
25
|
|
105
|
|
|
|
|
|
|
{ |
106
|
0
|
|
|
|
|
|
die "END blocks must be CODE references"; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
__END__ |