in reply to HTML::Template question
You might also consider a different approach when using HTML::Template.
my $fruit_field = q{banana}; my $food_field = q{banana}; my $param = ( is_a_banana => $fruit_field eq q{banana}?1:0, fruit_and_food => $fruit_field eq $food_field?1:0, );
Put the code (your expression) in the script and leave the template to look after the HTML. While I prefer this approach there are many monks who would argue in favour of, say, Template::Toolkit.<TMPL_IF is_a_banana> I'm a banana </TMPL_IF> <TMPL_IF fruit_and_food> eat fruit </TMPL_IF>
It's up to you which approach best suits your task.
|
|---|