line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Template; |
2
|
52
|
|
|
52
|
|
968
|
use Mojo::Base -base; |
|
52
|
|
|
|
|
160
|
|
|
52
|
|
|
|
|
410
|
|
3
|
|
|
|
|
|
|
|
4
|
52
|
|
|
52
|
|
397
|
use Carp qw(croak); |
|
52
|
|
|
|
|
179
|
|
|
52
|
|
|
|
|
2662
|
|
5
|
52
|
|
|
52
|
|
419
|
use Mojo::ByteStream; |
|
52
|
|
|
|
|
220
|
|
|
52
|
|
|
|
|
2189
|
|
6
|
52
|
|
|
52
|
|
900
|
use Mojo::Exception; |
|
52
|
|
|
|
|
191
|
|
|
52
|
|
|
|
|
2386
|
|
7
|
52
|
|
|
52
|
|
415
|
use Mojo::File qw(path); |
|
52
|
|
|
|
|
155
|
|
|
52
|
|
|
|
|
2761
|
|
8
|
52
|
|
|
52
|
|
459
|
use Mojo::Util qw(decode encode monkey_patch); |
|
52
|
|
|
|
|
150
|
|
|
52
|
|
|
|
|
4116
|
|
9
|
|
|
|
|
|
|
|
10
|
52
|
|
50
|
52
|
|
475
|
use constant DEBUG => $ENV{MOJO_TEMPLATE_DEBUG} || 0; |
|
52
|
|
|
|
|
137
|
|
|
52
|
|
|
|
|
162249
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has [qw(append code prepend unparsed)] => ''; |
13
|
|
|
|
|
|
|
has [qw(auto_escape compiled vars)]; |
14
|
|
|
|
|
|
|
has capture_end => 'end'; |
15
|
|
|
|
|
|
|
has capture_start => 'begin'; |
16
|
|
|
|
|
|
|
has comment_mark => '#'; |
17
|
|
|
|
|
|
|
has encoding => 'UTF-8'; |
18
|
|
|
|
|
|
|
has escape => sub { \&Mojo::Util::xml_escape }; |
19
|
|
|
|
|
|
|
has [qw(escape_mark expression_mark trim_mark)] => '='; |
20
|
|
|
|
|
|
|
has [qw(line_start replace_mark)] => '%'; |
21
|
|
|
|
|
|
|
has name => 'template'; |
22
|
|
|
|
|
|
|
has namespace => 'Mojo::Template::Sandbox'; |
23
|
|
|
|
|
|
|
has tag_start => '<%'; |
24
|
|
|
|
|
|
|
has tag_end => '%>'; |
25
|
|
|
|
|
|
|
has tree => sub { [] }; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub parse { |
28
|
377
|
|
|
377
|
1
|
979
|
my ($self, $template) = @_; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Clean start |
31
|
377
|
|
|
|
|
1252
|
$self->unparsed($template)->tree(\my @tree)->compiled(undef); |
32
|
|
|
|
|
|
|
|
33
|
377
|
|
|
|
|
1267
|
my $tag = $self->tag_start; |
34
|
377
|
|
|
|
|
1127
|
my $replace = $self->replace_mark; |
35
|
377
|
|
|
|
|
1161
|
my $expr = $self->expression_mark; |
36
|
377
|
|
|
|
|
1066
|
my $escp = $self->escape_mark; |
37
|
377
|
|
|
|
|
1075
|
my $cpen = $self->capture_end; |
38
|
377
|
|
|
|
|
1093
|
my $cmnt = $self->comment_mark; |
39
|
377
|
|
|
|
|
1216
|
my $cpst = $self->capture_start; |
40
|
377
|
|
|
|
|
1072
|
my $trim = $self->trim_mark; |
41
|
377
|
|
|
|
|
1006
|
my $end = $self->tag_end; |
42
|
377
|
|
|
|
|
995
|
my $start = $self->line_start; |
43
|
|
|
|
|
|
|
|
44
|
377
|
|
|
|
|
4465
|
my $line_re = qr/^(\s*)\Q$start\E(?:(\Q$replace\E)|(\Q$cmnt\E)|(\Q$expr\E))?(.*)$/; |
45
|
377
|
|
|
|
|
5374
|
my $token_re = qr/ |
46
|
|
|
|
|
|
|
( |
47
|
|
|
|
|
|
|
\Q$tag\E(?:\Q$replace\E|\Q$cmnt\E) # Replace |
48
|
|
|
|
|
|
|
| |
49
|
|
|
|
|
|
|
\Q$tag$expr\E(?:\Q$escp\E)?(?:\s*\Q$cpen\E(?!\w))? # Expression |
50
|
|
|
|
|
|
|
| |
51
|
|
|
|
|
|
|
\Q$tag\E(?:\s*\Q$cpen\E(?!\w))? # Code |
52
|
|
|
|
|
|
|
| |
53
|
|
|
|
|
|
|
(?:(?
|
54
|
|
|
|
|
|
|
) |
55
|
|
|
|
|
|
|
/x; |
56
|
377
|
|
|
|
|
2462
|
my $cpen_re = qr/^\Q$tag\E(?:\Q$expr\E)?(?:\Q$escp\E)?\s*\Q$cpen\E(.*)$/; |
57
|
377
|
|
|
|
|
2347
|
my $end_re = qr/^(?:(\Q$cpst\E)\s*)?(\Q$trim\E)?\Q$end\E$/; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Split lines |
60
|
377
|
|
|
|
|
742
|
my $op = 'text'; |
61
|
377
|
|
|
|
|
766
|
my ($trimming, $capture); |
62
|
377
|
|
|
|
|
4091
|
for my $line (split /\n/, $template) { |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Turn Perl line into mixed line |
65
|
4349
|
100
|
100
|
|
|
29533
|
if ($op eq 'text' && $line =~ $line_re) { |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# Escaped start |
68
|
1386
|
100
|
|
|
|
4498
|
if ($2) { $line = "$1$start$5" } |
|
9
|
100
|
|
|
|
41
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# Comment |
71
|
7
|
|
|
|
|
42
|
elsif ($3) { $line = "$tag$3 $trim$end" } |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Expression or code |
74
|
1370
|
100
|
|
|
|
6117
|
else { $line = $4 ? "$1$tag$4$5 $end" : "$tag$5 $trim$end" } |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# Escaped line ending |
78
|
4349
|
100
|
100
|
|
|
21155
|
$line .= "\n" if $line !~ s/\\\\$/\\\n/ && $line !~ s/\\$//; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# Mixed line |
81
|
4349
|
|
|
|
|
80914
|
for my $token (split $token_re, $line) { |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Capture end |
84
|
12362
|
100
|
|
|
|
43075
|
($token, $capture) = ("$tag$1", 1) if $token =~ $cpen_re; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# End |
87
|
12362
|
100
|
100
|
|
|
62154
|
if ($op ne 'text' && $token =~ $end_re) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# Capture start |
90
|
1993
|
100
|
|
|
|
5867
|
splice @tree, -1, 0, ['cpst'] if $1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
# Trim left side |
93
|
1993
|
100
|
100
|
|
|
7051
|
_trim(\@tree) if ($trimming = $2) && @tree > 1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# Hint at end |
96
|
1993
|
|
|
|
|
6507
|
push @tree, [$op = 'text', '']; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# Code |
100
|
841
|
|
|
|
|
1445
|
elsif ($token eq $tag) { $op = 'code' } |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
# Expression |
103
|
1083
|
|
|
|
|
1972
|
elsif ($token eq "$tag$expr") { $op = 'expr' } |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
# Expression that needs to be escaped |
106
|
59
|
|
|
|
|
119
|
elsif ($token eq "$tag$expr$escp") { $op = 'escp' } |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
# Comment |
109
|
10
|
|
|
|
|
24
|
elsif ($token eq "$tag$cmnt") { $op = 'cmnt' } |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# Text (comments are just ignored) |
112
|
|
|
|
|
|
|
elsif ($op ne 'cmnt') { |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# Replace |
115
|
8364
|
100
|
|
|
|
15937
|
$token = $tag if $token eq "$tag$replace"; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# Trim right side (convert whitespace to line noise) |
118
|
8364
|
100
|
100
|
|
|
18155
|
if ($trimming && $token =~ s/^(\s+)//) { |
119
|
786
|
|
|
|
|
2677
|
push @tree, ['code', $1]; |
120
|
786
|
|
|
|
|
1326
|
$trimming = 0; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
# Token (with optional capture end) |
124
|
8364
|
100
|
|
|
|
23778
|
push @tree, $capture ? ['cpen'] : (), [$op, $token]; |
125
|
8364
|
|
|
|
|
14565
|
$capture = 0; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
# Optimize successive text lines separated by a newline |
130
|
4349
|
100
|
50
|
|
|
32783
|
push @tree, ['line'] and next |
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
66
|
|
|
|
|
131
|
|
|
|
|
|
|
if $tree[-4] && $tree[-4][0] ne 'line' |
132
|
|
|
|
|
|
|
|| (!$tree[-3] || $tree[-3][0] ne 'text' || $tree[-3][1] !~ /\n$/) |
133
|
|
|
|
|
|
|
|| ($tree[-2][0] ne 'line' || $tree[-1][0] ne 'text'); |
134
|
1861
|
|
|
|
|
7091
|
$tree[-3][1] .= pop(@tree)->[1]; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
377
|
|
|
|
|
3361
|
return $self; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub process { |
141
|
545
|
|
|
545
|
1
|
1656
|
my $self = shift; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# Use a local stack trace for compile exceptions |
144
|
545
|
|
|
|
|
1578
|
my $compiled = $self->compiled; |
145
|
545
|
100
|
|
|
|
1454
|
unless ($compiled) { |
146
|
377
|
|
|
|
|
1195
|
my $code = $self->_compile->code; |
147
|
377
|
|
|
|
|
1347
|
monkey_patch $self->namespace, '_escape', $self->escape; |
148
|
377
|
100
|
|
|
|
1575
|
return Mojo::Exception->new($@)->inspect($self->unparsed, $code)->trace->verbose(1) |
149
|
|
|
|
|
|
|
unless $compiled = eval $self->_wrap($code, @_); |
150
|
370
|
|
|
|
|
121904
|
$self->compiled($compiled); |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
# Use a real stack trace for normal exceptions |
154
|
|
|
|
|
|
|
local $SIG{__DIE__} = sub { |
155
|
48
|
100
|
|
48
|
|
632
|
CORE::die $_[0] if ref $_[0]; |
156
|
45
|
|
|
|
|
397
|
CORE::die Mojo::Exception->new(shift)->trace->inspect($self->unparsed, $self->code)->verbose(1); |
157
|
538
|
|
|
|
|
4534
|
}; |
158
|
|
|
|
|
|
|
|
159
|
538
|
|
|
|
|
1145
|
my $output; |
160
|
538
|
100
|
|
|
|
946
|
return eval { $output = $compiled->(@_); 1 } ? $output : $@; |
|
538
|
|
|
|
|
1810
|
|
|
516
|
|
|
|
|
10561
|
|
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
376
|
|
|
376
|
1
|
3116
|
sub render { shift->parse(shift)->process(@_) } |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub render_file { |
166
|
57
|
|
|
57
|
1
|
216
|
my ($self, $path) = (shift, shift); |
167
|
|
|
|
|
|
|
|
168
|
57
|
100
|
|
|
|
245
|
$self->name($path) unless defined $self->{name}; |
169
|
57
|
|
|
|
|
235
|
my $template = path($path)->slurp; |
170
|
57
|
|
|
|
|
383
|
my $encoding = $self->encoding; |
171
|
57
|
100
|
66
|
|
|
549
|
croak qq{Template "$path" has invalid encoding} if $encoding && !defined($template = decode $encoding, $template); |
172
|
|
|
|
|
|
|
|
173
|
56
|
|
|
|
|
419
|
return $self->render($template, @_); |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub _compile { |
177
|
377
|
|
|
377
|
|
659
|
my $self = shift; |
178
|
|
|
|
|
|
|
|
179
|
377
|
|
|
|
|
953
|
my $tree = $self->tree; |
180
|
377
|
|
|
|
|
1209
|
my $escape = $self->auto_escape; |
181
|
|
|
|
|
|
|
|
182
|
377
|
|
|
|
|
1081
|
my @blocks = (''); |
183
|
377
|
|
|
|
|
734
|
my ($i, $capture, $multi); |
184
|
377
|
|
100
|
|
|
2155
|
while (++$i <= @$tree && (my $next = $tree->[$i])) { |
185
|
11661
|
|
|
|
|
14903
|
my ($op, $value) = @{$tree->[$i - 1]}; |
|
11661
|
|
|
|
|
22140
|
|
186
|
11661
|
100
|
50
|
|
|
27223
|
push @blocks, '' and next if $op eq 'line'; |
187
|
9548
|
|
100
|
|
|
18262
|
my $newline = chomp($value //= ''); |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
# Text (quote and fix line ending) |
190
|
9548
|
100
|
100
|
|
|
18708
|
if ($op eq 'text') { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
191
|
6489
|
|
|
|
|
13931
|
$value = join "\n", map { quotemeta $_ } split(/\n/, $value, -1); |
|
3481
|
|
|
|
|
9298
|
|
192
|
6489
|
100
|
|
|
|
12207
|
$value .= '\n' if $newline; |
193
|
6489
|
100
|
|
|
|
15297
|
$blocks[-1] .= "\$_O .= \"" . $value . "\";" if length $value; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
# Code or multi-line expression |
197
|
1673
|
|
|
|
|
2735
|
elsif ($op eq 'code' || $multi) { $blocks[-1] .= $value } |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
# Capture end |
200
|
|
|
|
|
|
|
elsif ($op eq 'cpen') { |
201
|
122
|
|
|
|
|
337
|
$blocks[-1] .= 'return Mojo::ByteStream->new($_O) }'; |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
# No following code |
204
|
122
|
100
|
50
|
|
|
1012
|
$blocks[-1] .= ';' if $next->[0] ne 'cpst' && ($next->[1] // '') =~ /^\s*$/; |
|
|
|
100
|
|
|
|
|
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# Expression |
208
|
9548
|
100
|
100
|
|
|
26015
|
if ($op eq 'expr' || $op eq 'escp') { |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
# Escaped |
211
|
1156
|
100
|
100
|
|
|
6222
|
if (!$multi && ($op eq 'escp' && !$escape || $op eq 'expr' && $escape)) { |
|
|
100
|
100
|
|
|
|
|
212
|
950
|
|
|
|
|
2171
|
$blocks[-1] .= "\$_O .= _escape scalar + $value"; |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
# Raw |
216
|
192
|
|
|
|
|
521
|
elsif (!$multi) { $blocks[-1] .= "\$_O .= scalar + $value" } |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
# Multi-line |
219
|
1156
|
|
66
|
|
|
3495
|
$multi = !$next || $next->[0] ne 'text'; |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
# Append semicolon |
222
|
1156
|
100
|
100
|
|
|
4357
|
$blocks[-1] .= ';' unless $multi || $capture; |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
# Capture start |
226
|
9548
|
100
|
|
|
|
36008
|
if ($op eq 'cpst') { $capture = 1 } |
|
122
|
100
|
|
|
|
467
|
|
227
|
|
|
|
|
|
|
elsif ($capture) { |
228
|
122
|
|
|
|
|
310
|
$blocks[-1] .= "sub { my \$_O = ''; "; |
229
|
122
|
|
|
|
|
462
|
$capture = 0; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
|
233
|
377
|
|
|
|
|
3315
|
return $self->code(join "\n", @blocks)->tree([]); |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub _line { |
237
|
754
|
|
|
754
|
|
2228
|
my $name = shift->name; |
238
|
754
|
|
|
|
|
2241
|
$name =~ y/"//d; |
239
|
754
|
|
|
|
|
1192
|
return qq{#line @{[shift]} "$name"}; |
|
754
|
|
|
|
|
3223
|
|
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub _trim { |
243
|
785
|
|
|
785
|
|
1265
|
my $tree = shift; |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
# Skip captures |
246
|
785
|
100
|
100
|
|
|
3299
|
my $i = $tree->[-2][0] eq 'cpst' || $tree->[-2][0] eq 'cpen' ? -3 : -2; |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
# Only trim text |
249
|
785
|
100
|
|
|
|
1673
|
return unless $tree->[$i][0] eq 'text'; |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
# Convert whitespace text to line noise |
252
|
774
|
100
|
|
|
|
2133
|
splice @$tree, $i, 0, ['code', $1] if $tree->[$i][1] =~ s/(\s+)$//; |
253
|
|
|
|
|
|
|
} |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
sub _wrap { |
256
|
377
|
|
|
377
|
|
907
|
my ($self, $body, $vars) = @_; |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
# Variables |
259
|
377
|
|
|
|
|
719
|
my $args = ''; |
260
|
377
|
100
|
100
|
|
|
1009
|
if ($self->vars && (my @vars = grep {/^\w+$/} keys %$vars)) { |
|
963
|
|
|
|
|
3502
|
|
261
|
134
|
|
|
|
|
427
|
$args = 'my (' . join(',', map {"\$$_"} @vars) . ')'; |
|
389
|
|
|
|
|
1095
|
|
262
|
134
|
|
|
|
|
565
|
$args .= '= @{shift()}{qw(' . join(' ', @vars) . ')};'; |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# Wrap lines |
266
|
377
|
|
|
|
|
2477
|
my $num = () = $body =~ /\n/g; |
267
|
377
|
|
|
|
|
1302
|
my $code = $self->_line(1) . "\npackage @{[$self->namespace]};"; |
|
377
|
|
|
|
|
985
|
|
268
|
377
|
|
|
|
|
1053
|
$code .= "use Mojo::Base -strict; no warnings 'ambiguous';"; |
269
|
377
|
|
|
|
|
699
|
$code .= "sub { my \$_O = ''; @{[$self->prepend]};{ $args { $body\n"; |
|
377
|
|
|
|
|
1024
|
|
270
|
377
|
|
|
|
|
1204
|
$code .= $self->_line($num + 1) . "\n;}@{[$self->append]}; } \$_O };"; |
|
377
|
|
|
|
|
1169
|
|
271
|
|
|
|
|
|
|
|
272
|
377
|
|
|
|
|
748
|
warn "-- Code for @{[$self->name]}\n@{[encode 'UTF-8', $code]}\n\n" if DEBUG; |
273
|
377
|
|
|
|
|
127444
|
return $code; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
1; |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=encoding utf8 |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=head1 NAME |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
Mojo::Template - Perl-ish templates |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=head1 SYNOPSIS |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
use Mojo::Template; |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
# Use Perl modules |
289
|
|
|
|
|
|
|
my $mt = Mojo::Template->new; |
290
|
|
|
|
|
|
|
say $mt->render(<<'EOF'); |
291
|
|
|
|
|
|
|
% use Time::Piece; |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
% my $now = localtime; |
294
|
|
|
|
|
|
|
Time: <%= $now->hms %> |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
EOF |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
# Render with arguments |
299
|
|
|
|
|
|
|
say $mt->render(<<'EOF', [1 .. 13], 'Hello World!'); |
300
|
|
|
|
|
|
|
% my ($numbers, $title) = @_; |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
<%= $title %> |
303
|
|
|
|
|
|
|
% for my $i (@$numbers) { |
304
|
|
|
|
|
|
|
Test <%= $i %> |
305
|
|
|
|
|
|
|
% } |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
EOF |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
# Render with named variables |
310
|
|
|
|
|
|
|
say $mt->vars(1)->render(<<'EOF', {title => 'Hello World!'}); |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
<%= $title %> |
313
|
|
|
|
|
|
|
%= 5 + 5 |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
EOF |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=head1 DESCRIPTION |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
L is a minimalistic, fast, and very Perl-ish template engine, designed specifically for all those small |
320
|
|
|
|
|
|
|
tasks that come up during big projects. Like preprocessing a configuration file, generating text from heredocs and |
321
|
|
|
|
|
|
|
stuff like that. |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
See L for information on how to generate content with the L renderer. |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=head1 SYNTAX |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
For all templates L, L, L and Perl 5.16 L are automatically enabled. |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
<% Perl code %> |
330
|
|
|
|
|
|
|
<%= Perl expression, replaced with result %> |
331
|
|
|
|
|
|
|
<%== Perl expression, replaced with XML escaped result %> |
332
|
|
|
|
|
|
|
<%# Comment, useful for debugging %> |
333
|
|
|
|
|
|
|
<%% Replaced with "<%", useful for generating templates %> |
334
|
|
|
|
|
|
|
% Perl code line, treated as "<% line =%>" (explained later) |
335
|
|
|
|
|
|
|
%= Perl expression line, treated as "<%= line %>" |
336
|
|
|
|
|
|
|
%== Perl expression line, treated as "<%== line %>" |
337
|
|
|
|
|
|
|
%# Comment line, useful for debugging |
338
|
|
|
|
|
|
|
%% Replaced with "%", useful for generating templates |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
Escaping behavior can be reversed with the L"auto_escape"> attribute, this is the default in L C<.ep> |
341
|
|
|
|
|
|
|
templates, for example. |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
<%= Perl expression, replaced with XML escaped result %> |
344
|
|
|
|
|
|
|
<%== Perl expression, replaced with result %> |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
L objects are always excluded from automatic escaping. |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
% use Mojo::ByteStream qw(b); |
349
|
|
|
|
|
|
|
<%= b(' excluded! ') %> |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
Whitespace characters around tags can be trimmed by adding an additional equal sign to the end of a tag. |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
<% for (1 .. 3) { %> |
354
|
|
|
|
|
|
|
<%= 'Trim all whitespace characters around this expression' =%> |
355
|
|
|
|
|
|
|
<% } %> |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
Newline characters can be escaped with a backslash. |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
This is <%= 1 + 1 %> a\ |
360
|
|
|
|
|
|
|
single line |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
And a backslash in front of a newline character can be escaped with another backslash. |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
This will <%= 1 + 1 %> result\\ |
365
|
|
|
|
|
|
|
in multiple\\ |
366
|
|
|
|
|
|
|
lines |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
A newline character gets appended automatically to every template, unless the last character is a backslash. And empty |
369
|
|
|
|
|
|
|
lines at the end of a template are ignored. |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
There is <%= 1 + 1 %> no newline at the end here\ |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
You can capture whole template blocks for reuse later with the C and C keywords. Just be aware that both |
374
|
|
|
|
|
|
|
keywords are part of the surrounding tag and not actual Perl code, so there can only be whitespace after C and |
375
|
|
|
|
|
|
|
before C. |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
<% my $block = begin %> |
378
|
|
|
|
|
|
|
<% my $name = shift; =%> |
379
|
|
|
|
|
|
|
Hello <%= $name %>. |
380
|
|
|
|
|
|
|
<% end %> |
381
|
|
|
|
|
|
|
<%= $block->('Baerbel') %> |
382
|
|
|
|
|
|
|
<%= $block->('Wolfgang') %> |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
Perl lines can also be indented freely. |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
% my $block = begin |
387
|
|
|
|
|
|
|
% my $name = shift; |
388
|
|
|
|
|
|
|
Hello <%= $name %>. |
389
|
|
|
|
|
|
|
% end |
390
|
|
|
|
|
|
|
%= $block->('Baerbel') |
391
|
|
|
|
|
|
|
%= $block->('Wolfgang') |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
L templates get compiled to a Perl subroutine, that means you can access arguments simply via C<@_>. |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
% my ($foo, $bar) = @_; |
396
|
|
|
|
|
|
|
% my $x = shift; |
397
|
|
|
|
|
|
|
test 123 <%= $foo %> |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
The compilation of templates to Perl code can make debugging a bit tricky, but L will return |
400
|
|
|
|
|
|
|
L objects that stringify to error messages with context. |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
Bareword "xx" not allowed while "strict subs" in use at template line 4. |
403
|
|
|
|
|
|
|
Context: |
404
|
|
|
|
|
|
|
2: |
405
|
|
|
|
|
|
|
3: |
406
|
|
|
|
|
|
|
4: % my $i = 2; xx |
407
|
|
|
|
|
|
|
5: %= $i * 2 |
408
|
|
|
|
|
|
|
6: |
409
|
|
|
|
|
|
|
Traceback (most recent call first): |
410
|
|
|
|
|
|
|
File "template", line 4, in "Mojo::Template::Sandbox" |
411
|
|
|
|
|
|
|
File "path/to/Mojo/Template.pm", line 123, in "Mojo::Template" |
412
|
|
|
|
|
|
|
File "path/to/myapp.pl", line 123, in "main" |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
L implements the following attributes. |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
=head2 auto_escape |
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
my $bool = $mt->auto_escape; |
421
|
|
|
|
|
|
|
$mt = $mt->auto_escape($bool); |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
Activate automatic escaping. |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
# "<html>" |
426
|
|
|
|
|
|
|
Mojo::Template->new(auto_escape => 1)->render("<%= '' %>"); |
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
=head2 append |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
my $code = $mt->append; |
431
|
|
|
|
|
|
|
$mt = $mt->append('warn "Processed template"'); |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
Append Perl code to compiled template. Note that this code should not contain newline characters, or line numbers in |
434
|
|
|
|
|
|
|
error messages might end up being wrong. |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=head2 capture_end |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
my $end = $mt->capture_end; |
439
|
|
|
|
|
|
|
$mt = $mt->capture_end('end'); |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
Keyword indicating the end of a capture block, defaults to C. |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
<% my $block = begin %> |
444
|
|
|
|
|
|
|
Some data! |
445
|
|
|
|
|
|
|
<% end %> |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
=head2 capture_start |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
my $start = $mt->capture_start; |
450
|
|
|
|
|
|
|
$mt = $mt->capture_start('begin'); |
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
Keyword indicating the start of a capture block, defaults to C. |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
<% my $block = begin %> |
455
|
|
|
|
|
|
|
Some data! |
456
|
|
|
|
|
|
|
<% end %> |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
=head2 code |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
my $code = $mt->code; |
461
|
|
|
|
|
|
|
$mt = $mt->code($code); |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
Perl code for template if available. |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
=head2 comment_mark |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
my $mark = $mt->comment_mark; |
468
|
|
|
|
|
|
|
$mt = $mt->comment_mark('#'); |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
Character indicating the start of a comment, defaults to C<#>. |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
<%# This is a comment %> |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
=head2 compiled |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
my $compiled = $mt->compiled; |
477
|
|
|
|
|
|
|
$mt = $mt->compiled($compiled); |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
Compiled template code if available. |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
=head2 encoding |
482
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
my $encoding = $mt->encoding; |
484
|
|
|
|
|
|
|
$mt = $mt->encoding('UTF-8'); |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
Encoding used for template files, defaults to C. |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
=head2 escape |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
my $cb = $mt->escape; |
491
|
|
|
|
|
|
|
$mt = $mt->escape(sub {...}); |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
A callback used to escape the results of escaped expressions, defaults to L. |
494
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
$mt->escape(sub ($str) { return reverse $str }); |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
=head2 escape_mark |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
my $mark = $mt->escape_mark; |
500
|
|
|
|
|
|
|
$mt = $mt->escape_mark('='); |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
Character indicating the start of an escaped expression, defaults to C<=>. |
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
<%== $foo %> |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
=head2 expression_mark |
507
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
my $mark = $mt->expression_mark; |
509
|
|
|
|
|
|
|
$mt = $mt->expression_mark('='); |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
Character indicating the start of an expression, defaults to C<=>. |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
<%= $foo %> |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
=head2 line_start |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
my $start = $mt->line_start; |
518
|
|
|
|
|
|
|
$mt = $mt->line_start('%'); |
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
Character indicating the start of a code line, defaults to C<%>. |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
% $foo = 23; |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
=head2 name |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
my $name = $mt->name; |
527
|
|
|
|
|
|
|
$mt = $mt->name('foo.mt'); |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
Name of template currently being processed, defaults to C. Note that this value should not contain quotes or |
530
|
|
|
|
|
|
|
newline characters, or error messages might end up being wrong. |
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
=head2 namespace |
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
my $namespace = $mt->namespace; |
535
|
|
|
|
|
|
|
$mt = $mt->namespace('main'); |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
Namespace used to compile templates, defaults to C. Note that namespaces should only be shared |
538
|
|
|
|
|
|
|
very carefully between templates, since functions and global variables will not be cleared automatically. |
539
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
=head2 prepend |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
my $code = $mt->prepend; |
543
|
|
|
|
|
|
|
$mt = $mt->prepend('my $self = shift;'); |
544
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
Prepend Perl code to compiled template. Note that this code should not contain newline characters, or line numbers in |
546
|
|
|
|
|
|
|
error messages might end up being wrong. |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
=head2 replace_mark |
549
|
|
|
|
|
|
|
|
550
|
|
|
|
|
|
|
my $mark = $mt->replace_mark; |
551
|
|
|
|
|
|
|
$mt = $mt->replace_mark('%'); |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
Character used for escaping the start of a tag or line, defaults to C<%>. |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
<%% my $foo = 23; %> |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
=head2 tag_start |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
my $start = $mt->tag_start; |
560
|
|
|
|
|
|
|
$mt = $mt->tag_start('<%'); |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
Characters indicating the start of a tag, defaults to C%>. |
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
<% $foo = 23; %> |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
=head2 tag_end |
567
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
my $end = $mt->tag_end; |
569
|
|
|
|
|
|
|
$mt = $mt->tag_end('%>'); |
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
Characters indicating the end of a tag, defaults to C<%E>. |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
<%= $foo %> |
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
=head2 tree |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
my $tree = $mt->tree; |
578
|
|
|
|
|
|
|
$mt = $mt->tree([['text', 'foo'], ['line']]); |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
Template in parsed form if available. Note that this structure should only be used very carefully since it is very |
581
|
|
|
|
|
|
|
dynamic. |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
=head2 trim_mark |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
my $mark = $mt->trim_mark; |
586
|
|
|
|
|
|
|
$mt = $mt->trim_mark('-'); |
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
Character activating automatic whitespace trimming, defaults to C<=>. |
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
<%= $foo =%> |
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
=head2 unparsed |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
my $unparsed = $mt->unparsed; |
595
|
|
|
|
|
|
|
$mt = $mt->unparsed('<%= 1 + 1 %>'); |
596
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
Raw unparsed template if available. |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
=head2 vars |
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
my $bool = $mt->vars; |
602
|
|
|
|
|
|
|
$mt = $mt->vars($bool); |
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
Instead of a list of values, use a hash reference with named variables to pass data to templates. |
605
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
# "works!" |
607
|
|
|
|
|
|
|
Mojo::Template->new(vars => 1)->render('<%= $test %>!', {test => 'works'}); |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
=head1 METHODS |
610
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
L inherits all methods from L and implements the following new ones. |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
=head2 parse |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
$mt = $mt->parse('<%= 1 + 1 %>'); |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
Parse template into L"tree">. |
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
=head2 process |
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
my $output = $mt->process; |
622
|
|
|
|
|
|
|
my $output = $mt->process(@args); |
623
|
|
|
|
|
|
|
my $output = $mt->process({foo => 'bar'}); |
624
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
Process previously parsed template and return the result, or a L object if rendering failed. |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
# Parse and process |
628
|
|
|
|
|
|
|
say Mojo::Template->new->parse('Hello <%= $_[0] %>')->process('Bender'); |
629
|
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
# Reuse template (for much better performance) |
631
|
|
|
|
|
|
|
my $mt = Mojo::Template->new; |
632
|
|
|
|
|
|
|
say $mt->render('Hello <%= $_[0] %>!', 'Bender'); |
633
|
|
|
|
|
|
|
say $mt->process('Fry'); |
634
|
|
|
|
|
|
|
say $mt->process('Leela'); |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
=head2 render |
637
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
my $output = $mt->render('<%= 1 + 1 %>'); |
639
|
|
|
|
|
|
|
my $output = $mt->render('<%= shift() + shift() %>', @args); |
640
|
|
|
|
|
|
|
my $output = $mt->render('<%= $foo %>', {foo => 'bar'}); |
641
|
|
|
|
|
|
|
|
642
|
|
|
|
|
|
|
Render template and return the result, or a L object if rendering failed. |
643
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
# Longer version |
645
|
|
|
|
|
|
|
my $output = $mt->parse('<%= 1 + 1 %>')->process; |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
# Render with arguments |
648
|
|
|
|
|
|
|
say Mojo::Template->new->render('<%= $_[0] %>', 'bar'); |
649
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
# Render with named variables |
651
|
|
|
|
|
|
|
say Mojo::Template->new(vars => 1)->render('<%= $foo %>', {foo => 'bar'}); |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
=head2 render_file |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
my $output = $mt->render_file('/tmp/foo.mt'); |
656
|
|
|
|
|
|
|
my $output = $mt->render_file('/tmp/foo.mt', @args); |
657
|
|
|
|
|
|
|
my $output = $mt->render_file('/tmp/bar.mt', {foo => 'bar'}); |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
Same as L"render">, but renders a template file. |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
=head1 DEBUGGING |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
You can set the C environment variable to get some advanced diagnostics information printed to |
664
|
|
|
|
|
|
|
C. |
665
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
MOJO_TEMPLATE_DEBUG=1 |
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
=head1 SEE ALSO |
669
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
L, L, L. |
671
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
=cut |