line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::AddTime; |
2
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
62
|
|
3
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
54
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use base qw(Template::Plugin); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1058
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
3
|
|
|
3
|
1
|
41264
|
my ($class, $context, $args ) = @_; |
10
|
|
|
|
|
|
|
my $filter = sub { |
11
|
2
|
|
|
2
|
|
133
|
my $context = shift; |
12
|
|
|
|
|
|
|
return sub { |
13
|
2
|
|
|
|
|
48
|
addtime( @_, $args ); |
14
|
2
|
|
|
|
|
12
|
}; |
15
|
3
|
|
|
|
|
18
|
}; |
16
|
3
|
|
|
|
|
18
|
$context->define_filter('addtime', [ $filter => 1 ]); |
17
|
3
|
|
|
|
|
77
|
return \&addtime; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub addtime_wrap { |
21
|
0
|
|
|
0
|
0
|
0
|
my ($context, @args) = @_; |
22
|
|
|
|
|
|
|
sub { |
23
|
0
|
|
|
0
|
|
0
|
my $to = shift; |
24
|
0
|
|
|
|
|
0
|
return addtime( $to, @_ ); |
25
|
0
|
|
|
|
|
0
|
}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub addtime { |
29
|
3
|
|
|
3
|
0
|
32
|
my ($to,$base) = @_; |
30
|
3
|
|
100
|
|
|
19
|
$base ||= ''; |
31
|
3
|
|
|
|
|
6
|
my $file = $base . $to; |
32
|
3
|
|
|
|
|
135
|
my $addtime = (stat( $file ))[9]; |
33
|
3
|
|
|
|
|
25
|
return "$to?$addtime"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |