hello monks,

I'm writing a template system. before everybody says, omg, not another one, please let me explain a bit =)

I personally like HTML::Template because of its restrictions, because it is small and easy to use. what I don't like is that it is not too fast. it's fast enough for many applications, but sometimes you want it faster =)
I also don't like that you either just have access to the current level of parameters, or to every level. another thing is the syntax TMPL_*. (ok, I know i can use filters...).
also you always have to feed it a hash, it can't work with object-methods.

if I'm wrong with some of these assumptions above or below, I'm glad if you correct me.

I've also looked at Template-Toolkit, but I'm not too happy with its syntax either. what I don't know is how fast it is and how much memory it uses compared to other systems. I haven't found a comparison in the web yet.

Well, and last but not least, I wanted to see if I can program it myself =)

one question I have is about the module name - the Template-namespace is practically "owned" by TT. As my module started from HTML::Template I called it HTML::Template::Compiled (HTC). I like the name; is it too long though?

the manpage of the current version is located at HTC.html, you can download it at HTML-Template-Compiled-0.28.tar.gz (or for the latest version my download section)

I'd be glad about any comments.
The first goal of the module is that it works with most HTML::Template files (doesn't implement all features of it, though), and that it is faster than that. it compiles the template to perl code (like TT can do).

update: I'm also interested in what features HTML::Template users would like to see implemented.

update2: I added case_insensitive var names (optional) in version HTML-Template-Compiled-0.30.tar.gz and the benchmark script is now in examples/bench.pl

update3: i'm now thinking about 'Text::CTemplate' which hides the origin but is a better namespaces IMHO.

update 27.08.2005: on CPAN now: HTML::Template::Compiled


In reply to developing a template system by tinita

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.