line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1751
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Memoize::Storable; |
4
|
|
|
|
|
|
|
our $VERSION = '1.16'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1883
|
use Storable 1.002 (); # for lock_* function variants |
|
1
|
|
|
|
|
3430
|
|
|
1
|
|
|
|
|
544
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $Verbose; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub TIEHASH { |
11
|
5
|
|
|
5
|
|
1715
|
my $package = shift; |
12
|
5
|
|
|
|
|
9
|
my $filename = shift; |
13
|
5
|
100
|
|
|
|
77
|
my $truehash = (-e $filename) ? Storable::lock_retrieve($filename) : {}; |
14
|
5
|
|
|
|
|
262
|
my %options; |
15
|
5
|
50
|
|
|
|
14
|
print STDERR "Memoize::Storable::TIEHASH($filename, @_)\n" if $Verbose; |
16
|
5
|
|
|
|
|
15
|
@options{@_} = (1) x @_; |
17
|
5
|
|
|
|
|
20
|
my $self = |
18
|
|
|
|
|
|
|
{FILENAME => $filename, |
19
|
|
|
|
|
|
|
H => $truehash, |
20
|
|
|
|
|
|
|
OPTIONS => \%options |
21
|
|
|
|
|
|
|
}; |
22
|
5
|
|
|
|
|
32
|
bless $self => $package; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub STORE { |
26
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
27
|
1
|
50
|
|
|
|
4
|
print STDERR "Memoize::Storable::STORE(@_)\n" if $Verbose; |
28
|
1
|
|
|
|
|
3
|
$self->{H}{$_[0]} = $_[1]; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub FETCH { |
32
|
2
|
|
|
2
|
|
5
|
my $self = shift; |
33
|
2
|
50
|
|
|
|
4
|
print STDERR "Memoize::Storable::FETCH(@_)\n" if $Verbose; |
34
|
2
|
|
|
|
|
15
|
$self->{H}{$_[0]}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub EXISTS { |
38
|
4
|
|
|
4
|
|
865
|
my $self = shift; |
39
|
4
|
50
|
|
|
|
11
|
print STDERR "Memoize::Storable::EXISTS(@_)\n" if $Verbose; |
40
|
4
|
|
|
|
|
22
|
exists $self->{H}{$_[0]}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub DESTROY { |
44
|
5
|
|
|
5
|
|
24
|
my $self= shift; |
45
|
5
|
50
|
|
|
|
8
|
print STDERR "Memoize::Storable::DESTROY(@_)\n" if $Verbose; |
46
|
5
|
100
|
|
|
|
14
|
if ($self->{OPTIONS}{'nstore'}) { |
47
|
1
|
|
|
|
|
4
|
Storable::lock_nstore($self->{H}, $self->{FILENAME}); |
48
|
|
|
|
|
|
|
} else { |
49
|
4
|
|
|
|
|
12
|
Storable::lock_store($self->{H}, $self->{FILENAME}); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub FIRSTKEY { |
54
|
0
|
|
|
0
|
|
|
'Fake hash from Memoize::Storable'; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub NEXTKEY { |
58
|
0
|
|
|
0
|
|
|
undef; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |