line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::Filter::Hash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
29
|
use 5.008; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
47
|
|
4
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Tie::Filter; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
563
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Tie::Filter::Hash - Tie a facade around a hash |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Don't use this class directly. Instead, use L. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub TIEHASH { |
22
|
1
|
|
|
1
|
|
7
|
my ($class, $hash, %args) = @_; |
23
|
1
|
|
|
|
|
3
|
$args{WRAP} = $hash; |
24
|
1
|
|
|
|
|
7
|
return bless \%args, $class; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub FETCH { |
28
|
5
|
|
|
5
|
|
1037
|
my ($self, $key) = @_; |
29
|
5
|
|
|
|
|
17
|
Tie::Filter::_filter($$self{FETCHVALUE}, |
30
|
|
|
|
|
|
|
$$self{WRAP}{Tie::Filter::_filter($$self{STOREKEY}, $key)}); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub STORE { |
34
|
3
|
|
|
3
|
|
535
|
my ($self, $key, $value) = @_; |
35
|
3
|
|
|
|
|
14
|
$$self{WRAP}{Tie::Filter::_filter($$self{STOREKEY}, $key)} = |
36
|
|
|
|
|
|
|
Tie::Filter::_filter($$self{STOREVALUE}, $value); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub DELETE { |
40
|
1
|
|
|
1
|
|
3
|
my ($self, $key) = @_; |
41
|
1
|
|
|
|
|
5
|
delete $$self{WRAP}{Tie::Filter::_filter($$self{STOREKEY}, $key)}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub CLEAR { |
45
|
1
|
|
|
1
|
|
2858
|
my $self = shift; |
46
|
1
|
|
|
|
|
34
|
%{$$self{WRAP}} = (); |
|
1
|
|
|
|
|
7
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub EXISTS { |
50
|
1
|
|
|
1
|
|
1732
|
my ($self, $key) = @_; |
51
|
1
|
|
|
|
|
6
|
exists $$self{WRAP}{Tie::Filter::_filter($$self{STOREKEY}, $key)}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub FIRSTKEY { |
55
|
2
|
|
|
2
|
|
7
|
my $self = shift; |
56
|
2
|
|
|
|
|
4
|
my $a = keys %{$$self{WRAP}}; |
|
2
|
|
|
|
|
6
|
|
57
|
2
|
50
|
|
|
|
4
|
if (my ($k) = each %{$$self{WRAP}}) { |
|
2
|
|
|
|
|
10
|
|
58
|
2
|
|
|
|
|
9
|
return (Tie::Filter::_filter($$self{FETCHKEY}, $k)); |
59
|
|
|
|
|
|
|
} else { |
60
|
0
|
|
|
|
|
0
|
return (); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub NEXTKEY { |
65
|
4
|
|
|
4
|
|
7
|
my $self = shift; |
66
|
4
|
100
|
|
|
|
6
|
if (my ($k) = each %{$$self{WRAP}}) { |
|
4
|
|
|
|
|
13
|
|
67
|
2
|
|
|
|
|
8
|
return (Tie::Filter::_filter($$self{FETCHKEY}, $k)); |
68
|
|
|
|
|
|
|
} else { |
69
|
2
|
|
|
|
|
15
|
return (); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
0
|
|
|
sub UNTIE { } |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
0
|
|
|
sub DESTROY { } |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SEE ALSO |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L, L |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 AUTHOR |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Andrew Sterling Hanenkamp, |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Copyright 2003 Andrew Sterling Hanenkamp. All Rights Reserved. This library is |
88
|
|
|
|
|
|
|
free software; you can redistribute it and/or modify it under the same terms as |
89
|
|
|
|
|
|
|
Perl itself. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1 |