line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Text::Template::Preprocess; |
3
|
|
|
|
|
|
|
$Text::Template::Preprocess::VERSION = '1.60'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Expand template text with embedded Perl |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1691
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
62
|
|
7
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
1346
|
use Text::Template; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
409
|
|
10
|
|
|
|
|
|
|
our @ISA = qw(Text::Template); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub fill_in { |
13
|
9
|
|
|
9
|
1
|
87
|
my $self = shift; |
14
|
9
|
|
|
|
|
25
|
my (%args) = @_; |
15
|
|
|
|
|
|
|
|
16
|
9
|
|
100
|
|
|
34
|
my $pp = $args{PREPROCESSOR} || $self->{PREPROCESSOR}; |
17
|
|
|
|
|
|
|
|
18
|
9
|
100
|
|
|
|
22
|
if ($pp) { |
19
|
7
|
|
|
|
|
23
|
local $_ = $self->source(); |
20
|
7
|
|
|
|
|
12
|
my $type = $self->{TYPE}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# print "# fill_in: before <$_>\n"; |
23
|
7
|
|
|
|
|
30
|
&$pp; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# print "# fill_in: after <$_>\n"; |
26
|
7
|
|
|
|
|
41
|
$self->set_source_data($_, $type); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
9
|
|
|
|
|
41
|
$self->SUPER::fill_in(@_); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub preprocessor { |
33
|
4
|
|
|
4
|
0
|
26
|
my ($self, $pp) = @_; |
34
|
|
|
|
|
|
|
|
35
|
4
|
|
|
|
|
8
|
my $old_pp = $self->{PREPROCESSOR}; |
36
|
|
|
|
|
|
|
|
37
|
4
|
50
|
|
|
|
17
|
$self->{PREPROCESSOR} = $pp if @_ > 1; # OK to pass $pp=undef |
38
|
|
|
|
|
|
|
|
39
|
4
|
|
|
|
|
8
|
$old_pp; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |