line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New::Template; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
18630
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
203
|
|
4
|
6
|
|
|
6
|
|
28
|
use warnings; |
|
6
|
|
|
|
|
74
|
|
|
6
|
|
|
|
|
140
|
|
5
|
6
|
|
|
6
|
|
3299
|
use Text::MicroTemplate (); |
|
6
|
|
|
|
|
18853
|
|
|
6
|
|
|
|
|
560
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# XXX: I'm still wondering if I should use Mojo::Template here... |
8
|
|
|
|
|
|
|
my $ENGINE = Text::MicroTemplate->new( |
9
|
|
|
|
|
|
|
expression_mark => '=', |
10
|
|
|
|
|
|
|
line_start => '%', |
11
|
|
|
|
|
|
|
tag_start => '<%', |
12
|
|
|
|
|
|
|
tag_end => '%>', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub render { |
16
|
67
|
|
|
67
|
1
|
129
|
my ($self, $template) = @_; |
17
|
|
|
|
|
|
|
|
18
|
67
|
|
|
|
|
175
|
$template = '% my $c = shift;'."\n".$template; |
19
|
67
|
|
|
|
|
212
|
$ENGINE->parse($template)->build->(Module::New->context)->as_string; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__ |