CC: | volker.voit [...] googlemail.com |
Subject: | <TMPL_NOPARSE> and a POD error |
Within a <TMPL_NOPARSE> section the occurance of half template-tags
confuse the parser. Once such a "half" template-tag is found, the
template will not be parsed until its end (see script 2/3).
When there is a complete template-tag there are no problems.
Another thing is a minor error in the pod:
Section tagstyles; own defined tags:
[
qr({{), start of opening tag
qr(}}), # end of opening tag
qr({{/), # start of closing tag
qr(}}), # end of closing tag
]
There should be a comment-sign in front of ‘start of opening tag‘.
Script 1: okay
use strict;
use warnings;
use HTML::Template::Compiled 0.93;
my $htc = HTML::Template::Compiled->new(
tagstyle => [qw(-classic -comment +asp)],
scalarref => \<<'EOT');
<%NOPARSE%><%= test%><%/NOPARSE%><%= test%>
EOT
$htc->param(test=>'ttt');
print $htc->output();
__END__
<%= test%>ttt
Script2: not okay
use strict;
use warnings;
use HTML::Template::Compiled 0.93;
my $htc = HTML::Template::Compiled->new(
tagstyle => [qw(-classic -comment +asp)],
scalarref => \<<'EOT');
<%NOPARSE%><%= <%/NOPARSE%><%= test%>
EOT
$htc->param(test=>'ttt');
print $htc->output();
__END__
<%= <%/NOPARSE%><%= test%>
Script 3: not okay (doesn´t matter if asp or classic tagstyle)
use strict;
use warnings;
use HTML::Template::Compiled 0.93;
my $htc = HTML::Template::Compiled->new(
scalarref => \<<'EOT');
<TMPL_NOPARSE><TMPL_VAR </TMPL_NOPARSE><TMPL_VAR test>
EOT
$htc->param(test=>'ttt');
print $htc->output();
__END__
<TMPL_VAR </TMPL_NOPARSE><TMPL_VAR test>