Is this possible?
No.
From the docs
...it enforces an important divide - design and programming.
The idea behind HTML::Template is that what you are trying to do is to put 'programming' in your template.
Why can't you put that regex in your param, something like
my $flag;
if (my_var =~ /some string/){
$flag++;
}
my $param = {
flag => $flag,
};
<TMPL_IF flag>
imo, this restriction is a good thing. It forces you to separate your logic from your presentation, and, I think, both your code and your templates are better for it. Another benifit is that H::T is a fast, easy to use, lightweight solution for most needs.
Perhaps consider something like Template::Toolkit if H::T is too restrictive for your needs.
updated: fixed link
| [reply] [Watch: Dir/Any] [d/l] [select] |