Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Follow-up to my Template question

by r.joseph (Hermit)
on Dec 23, 2000 at 13:30 UTC ( [id://48133]=perlquestion: print w/replies, xml ) Need Help??

r.joseph has asked for the wisdom of the Perl Monks concerning the following question:

Hello All! First off, thanks to everyone who responded to my previous post on HTML Templating languages and regular expressions and such. It really helped!

But alas, all the help has left with me with yet another conundrum - I cannot decide which templating languag to use! It had been suggested the the aforementioned post that I use HTML::Template, EmbedPerl, Text::Template, and the Template Toolkit. Now, I know that everyone has their personal opions on each of these, but I humbly ask for your opinions on which of these is easier to learn and easier to install. It seems that I have run out of time (for the 'ol job, no doubt) and no longer have time to doddle - I am unfortunately in great need of a good template package quickly.

So please, fellow wise ones, I hold your opinions in the highest of regards and would be most gracious if your assitance was provided on this matter. Thanks!

Best,
R.Joseph

Replies are listed 'Best First'.
Re: Follow-up to my Template question
by extremely (Priest) on Dec 23, 2000 at 16:11 UTC
    Embperl isn't for people in a hurry, I still have a warm place for it in my heart but there it is... Of the remaining, I'd recommend the Toolkit as the way to go. I twiddled with the defaults a little because I like angle brackets rather than square but the fact that you can change that alone makes it worth using. As to easier to install, all of the remaining are rather painless. Learning wise is a tougher question. For simple things they are all rather simple. For medium level tasks they all have quirks. For tough and weird tasks they are all outside my experience. =)

    --
    $you = new YOU;
    honk() if $you->love(perl)

(Ovid) Re: Follow-up to my Template question
by Ovid (Cardinal) on Dec 23, 2000 at 23:38 UTC
    Of the ones you mention, I have only used HTML::Template and Template Toolkit. I think that you will find HTML::Template to be ridiculously easy to use and, in fact, I have written a short tutorial on its use. Template Toolkit is more difficult to use (and I've found the documentation to be a tad confusing at times), but it's much more useful in the long run.

    Choosing a templating system also depends upon what you want to do. If you're just building a small site of about 20 or 30 pages, HTML::Template should be fine. But if you're building something larger, or likely to get larger, bite the bullet and learn one of the more complicated, but scaleable systems. We had considered using HTML::Template at our work and while it would definitely be an improvement over our current system, we realized that it was too limited. Don't take the easy path now if you're likely to regret it later!

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      Another templating module that I've found is CGI::FastTemplate. It's waaay simple...probably not good for enterprise sites, but it works for my itty-bitty projects.

      There's my $0.02.

      I use HTML::Template all the time and it's really nice at making easy things simple.

      I find it's really good for when you have non-programmers writing the HTML. You can tell them where to drop the <tmpl var> tags and let them design the rest.

      But I agree with Ovid that it may not be the best tool for big complicated sites. While HTML::Template supports looping and if/else in the templates, it starts getting kinda hairy if things get too complicated. This isn't a problem for my application (yet ;)), so HTML::Template is perfect for me.

      Good luck
Re: Follow-up to my Template question
by marius (Hermit) on Dec 24, 2000 at 02:28 UTC
    I've been fiddling with the Template Toolkit for the past few days, and it's fantastic. The conditionals are powerful and the way to do it makes sense. I did notice one error in the slides on the template-toolkit page in the MyHandler.pm that they give as a demo. Since the PerlModule in Apache needs an exit status of one, you just add a "1;" at the end of your MyHandler.pm file (or whatever you would like to call it.

    Other than that little issue, Template Toolkit rocks.

    -marius

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-19 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found