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