Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: HTML::Template question

by wfsp (Abbot)
on Feb 01, 2011 at 08:11 UTC ( [id://885434]=note: print w/replies, xml ) Need Help??


in reply to HTML::Template question

As Anonymous Monk has pointed out you may want to consider a different module.

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, );
<TMPL_IF is_a_banana> I'm a banana </TMPL_IF> <TMPL_IF fruit_and_food> eat fruit </TMPL_IF>
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.

It's up to you which approach best suits your task.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://885434]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-24 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found