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