I am having a brain fart and old-timer moment. I'm tired and not seeing something obvious...
Can I get a Monk to help me figure out how to check for truth when presenting an element with HTML::Template?
I have the following code which essentially sets a done flag to true or false:
... my $unfinished_bcasts = $Broadcast->unfinished; my $finished = 0; if (! grep { $bcast_id == $_ } @$unfinished_bcasts) { $finished = 1; } $bcast_data->{$bcast_id}{finished} = $finished; ...
I then have an HTML::Template template that has this:
<TMPL_IF NAME=FINISHED> <tr align="left"> <td><b>Time Finished</b></td> <td><TMPL_VAR NAME=TIME_FINISHED></td> </tr> </TMPL_IF>
My expectation is, is that the TIME_FINISHED var will appear in the HTML table *if* the FINISHED var is true. My issue is that no matter what I set FINISHED to, the TIME_FINISHED always appears in the HTML. I can confirm with certainty that both variables are being passed along properly to the template.
Please help me with what I'm completely missing.
-stevieb
In reply to Check for truth of variable in HTML::Template by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |