Subject: | HTML::Template::Extension::IF_TERN::_if_tern patch |
There is no reason to do 2 passes, or use $& (which slows perl down).
sub _if_tern {
my $t = shift;
$$t =~ s{\%(\S+?)\?(.*?)(\:(.*?))?\%}{
my $replace;
$replace = qq~<TMPL_IF NAME="$1">$2~;
if (defined $3) {
$replace .= qq~<TMPL_ELSE>$4</TMPL_IF>~;
} else {
$replace .= '</TMPL_IF>';
}
$replace;
}gmse;
return $$t;
}
You should do this for all your HTML::Template::Extension::
modules (basically all except do_nothing)
FYI, I've tested this one, it works