line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::Filter::Array; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
37
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
53
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
167
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Tie::Filter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1098
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Tie::Filter::Array - Tie a facade around an array |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Don't use this package directly. Instead, see L. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub TIEARRAY { |
22
|
1
|
|
|
1
|
|
6
|
my ($class, $array, %args) = @_; |
23
|
1
|
|
|
|
|
3
|
$args{WRAP} = $array; |
24
|
1
|
|
|
|
|
9
|
return bless \%args, $class; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub FETCH { |
28
|
5
|
|
|
5
|
|
989
|
my ($self, $index) = @_; |
29
|
5
|
|
|
|
|
20
|
Tie::Filter::_filter($$self{FETCH}, $$self{WRAP}[$index]); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub STORE { |
33
|
3
|
|
|
3
|
|
693
|
my ($self, $index, $value) = @_; |
34
|
3
|
|
|
|
|
13
|
$$self{WRAP}[$index] = Tie::Filter::_filter($$self{STORE}, $value); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub FETCHSIZE { |
38
|
3
|
|
|
3
|
|
322
|
my $self = shift; |
39
|
3
|
|
|
|
|
6
|
scalar(@{$$self{WRAP}}); |
|
3
|
|
|
|
|
12
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub STORESIZE { |
43
|
0
|
|
|
0
|
|
0
|
my ($self, $count) = @_; |
44
|
0
|
|
|
|
|
0
|
$#{$$self{WRAP}} = $count - 1; |
|
0
|
|
|
|
|
0
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# TODO (?) Detect if the wrappee is tied and call it's EXTEND if it is, |
48
|
|
|
|
|
|
|
# otherwise do nothing. |
49
|
1
|
|
|
1
|
|
4
|
sub EXTEND { } |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub EXISTS { |
52
|
1
|
|
|
1
|
|
2676
|
my ($self, $index) = @_; |
53
|
1
|
|
|
|
|
8
|
exists $$self{WRAP}[$index]; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub DELETE { |
57
|
1
|
|
|
1
|
|
4
|
my ($self, $index) = @_; |
58
|
1
|
|
|
|
|
6
|
delete $$self{WRAP}[$index]; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub CLEAR { |
62
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
63
|
1
|
|
|
|
|
2
|
@{$$self{WRAP}} = (); |
|
1
|
|
|
|
|
9
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub PUSH { |
67
|
0
|
|
|
0
|
|
|
my $self = shift; |
68
|
0
|
|
|
|
|
|
push @{$$self{WRAP}}, map Tie::Filter::_filter($$self{STORE}, $_), @_; |
|
0
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub POP { |
72
|
0
|
|
|
0
|
|
|
my $self = shift; |
73
|
0
|
|
|
|
|
|
Tie::Filter::_filter($$self{FETCH}, pop @{$$self{WRAP}}); |
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub SHIFT { |
77
|
0
|
|
|
0
|
|
|
my $self = shift; |
78
|
0
|
|
|
|
|
|
Tie::Filter::_filter($$self{FETCH}, shift @{$$self{WRAP}}); |
|
0
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub UNSHIFT { |
82
|
0
|
|
|
0
|
|
|
my $self = shift; |
83
|
0
|
|
|
|
|
|
unshift @{$$self{WRAP}}, map Tie::Filter::_filter($$self{STORE}, $_), @_; |
|
0
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub SPLICE { |
87
|
0
|
|
|
0
|
|
|
my $self = shift; |
88
|
0
|
|
|
|
|
|
my $offset = shift; |
89
|
0
|
|
|
|
|
|
my $length = shift; |
90
|
0
|
|
|
|
|
|
map(Tie::Filter::_filter($$self{FETCH}, $_), |
91
|
0
|
|
|
|
|
|
splice(@{$$self{WRAP}}, $offset, $length, |
92
|
|
|
|
|
|
|
map(Tie::Filter::_filter($$self{STORE}, $_), @_))); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
0
|
|
|
sub UNTIE { } |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
0
|
|
|
sub DESTROY { } |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 SEE ALSO |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
L, L |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Andrew Sterling Hanenkamp, |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Copyright 2003 Andrew Sterling Hanenkamp. All Rights Reserved. This library is |
110
|
|
|
|
|
|
|
free software; you can redistribute it and/or modify it under the same terms as |
111
|
|
|
|
|
|
|
Perl itself. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
1 |
116
|
|
|
|
|
|
|
|