line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::Timely; |
2
|
2
|
|
|
2
|
|
1197
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
51
|
|
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
9
|
use Carp qw(croak); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
317
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.022'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub TIESCALAR { |
9
|
1
|
|
|
1
|
|
501
|
my $class = shift; |
10
|
1
|
|
|
|
|
2
|
my $value = shift; |
11
|
1
|
|
|
|
|
3
|
my $lifetime = shift; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
3
|
my $self = bless [ undef, $lifetime, time ], $class; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
4
|
$self->STORE( $value ); |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
4
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
2
|
100
|
|
2
|
|
4000971
|
sub FETCH { time - $_[0]->[2] > $_[0]->[1] ? () : $_[0]->[0] } |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
3
|
sub STORE { @{ $_[0] }[0,2] = ( $_[1], time ) } |
|
1
|
|
|
|
|
5
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |