line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New::Template;
|
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
13358
|
use strict;
|
|
6
|
|
|
|
|
40
|
|
|
6
|
|
|
|
|
161
|
|
4
|
6
|
|
|
6
|
|
21
|
use warnings;
|
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
120
|
|
5
|
6
|
|
|
6
|
|
2351
|
use Text::MicroTemplate ();
|
|
6
|
|
|
|
|
13650
|
|
|
6
|
|
|
|
|
435
|
|
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
|
90
|
my ($self, $template) = @_;
|
17
|
|
|
|
|
|
|
|
18
|
67
|
|
|
|
|
110
|
$template = '% my $c = shift;'."\n".$template;
|
19
|
67
|
|
|
|
|
146
|
$ENGINE->parse($template)->build->(Module::New->context)->as_string;
|
20
|
|
|
|
|
|
|
}
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1;
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__
|