line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hash::RestrictedKeys; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
146788
|
use 5.006; |
|
2
|
|
|
|
|
18
|
|
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
72
|
|
5
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
6
|
2
|
|
|
2
|
|
863
|
use Hash::RestrictedKeys::Tie; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
138
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
2643
|
use overload '%{}' => sub { ${$_[0]}->{hash}; }, fallback => 1; |
|
2
|
|
|
7
|
|
2178
|
|
|
2
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
49
|
|
|
7
|
|
|
|
|
47
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
1
|
|
|
1
|
0
|
100
|
my ($class, @keys) = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
4
|
my $self = \{ |
16
|
|
|
|
|
|
|
hash => {}, |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
3
|
tie %{${$self}->{hash}}, 'Hash::RestrictedKeys::Tie', @keys; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
5
|
bless $self, $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |