line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New::Template;
|
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
14378
|
use strict;
|
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
205
|
|
4
|
6
|
|
|
6
|
|
25
|
use warnings;
|
|
6
|
|
|
|
|
5
|
|
|
6
|
|
|
|
|
135
|
|
5
|
6
|
|
|
6
|
|
2600
|
use Text::MicroTemplate ();
|
|
6
|
|
|
|
|
15619
|
|
|
6
|
|
|
|
|
564
|
|
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
|
82
|
my ($self, $template) = @_;
|
17
|
|
|
|
|
|
|
|
18
|
67
|
|
|
|
|
105
|
$template = '% my $c = shift;'."\n".$template;
|
19
|
67
|
|
|
|
|
142
|
$ENGINE->parse($template)->build->(Module::New->context)->as_string;
|
20
|
|
|
|
|
|
|
}
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1;
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__
|