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