line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1680
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
|
1
|
|
|
|
|
19
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Memoize::Storable; |
4
|
|
|
|
|
|
|
our $VERSION = '1.13'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
573
|
use Storable 1.002 (); # for lock_* function variants |
|
1
|
|
|
|
|
2984
|
|
|
1
|
|
|
|
|
419
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $Verbose; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub TIEHASH { |
11
|
5
|
|
|
5
|
|
1477
|
my $package = shift; |
12
|
5
|
|
|
|
|
7
|
my $filename = shift; |
13
|
5
|
100
|
|
|
|
60
|
my $truehash = (-e $filename) ? Storable::lock_retrieve($filename) : {}; |
14
|
5
|
|
|
|
|
174
|
my %options; |
15
|
5
|
50
|
|
|
|
11
|
print STDERR "Memoize::Storable::TIEHASH($filename, @_)\n" if $Verbose; |
16
|
5
|
|
|
|
|
13
|
@options{@_} = (1) x @_; |
17
|
5
|
|
|
|
|
14
|
my $self = |
18
|
|
|
|
|
|
|
{FILENAME => $filename, |
19
|
|
|
|
|
|
|
H => $truehash, |
20
|
|
|
|
|
|
|
OPTIONS => \%options |
21
|
|
|
|
|
|
|
}; |
22
|
5
|
|
|
|
|
24
|
bless $self => $package; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub STORE { |
26
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
27
|
1
|
50
|
|
|
|
12
|
print STDERR "Memoize::Storable::STORE(@_)\n" if $Verbose; |
28
|
1
|
|
|
|
|
6
|
$self->{H}{$_[0]} = $_[1]; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub FETCH { |
32
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
33
|
2
|
50
|
|
|
|
4
|
print STDERR "Memoize::Storable::FETCH(@_)\n" if $Verbose; |
34
|
2
|
|
|
|
|
12
|
$self->{H}{$_[0]}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub EXISTS { |
38
|
4
|
|
|
4
|
|
754
|
my $self = shift; |
39
|
4
|
50
|
|
|
|
8
|
print STDERR "Memoize::Storable::EXISTS(@_)\n" if $Verbose; |
40
|
4
|
|
|
|
|
13
|
exists $self->{H}{$_[0]}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub DESTROY { |
44
|
5
|
|
|
5
|
|
20
|
my $self= shift; |
45
|
5
|
50
|
|
|
|
12
|
print STDERR "Memoize::Storable::DESTROY(@_)\n" if $Verbose; |
46
|
5
|
100
|
|
|
|
10
|
if ($self->{OPTIONS}{'nstore'}) { |
47
|
1
|
|
|
|
|
5
|
Storable::lock_nstore($self->{H}, $self->{FILENAME}); |
48
|
|
|
|
|
|
|
} else { |
49
|
4
|
|
|
|
|
10
|
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__ |