Hi,

It doesn't look like you got all of your questions answered.  Listing all
the features Template provides that Text::Template doesn't would take a long
time since it's a very full-featured system, but here are some highlights:

- Simple dot notation for complex data access (foo.bar.baz)
- Caching that plays well with mod_perl (using the disk for a shared
object-file cache)
- Good support for includes of different kinds (i.e. processed or not)
- Convenient plug-in system for providing things like fancy table formatting
via simple commands.
- Filtering mechanism.
- Convenient macro definition capability.
- Built-in error handling.

> This seems a somewhat contradictory argument to me "I don't want the
> template creators to have to know Perl.  Instead, they'll have to know
this new
> perl-like language".

Here's an example that illustrates the difference.  This is done in ePerl
syntax, but it's about the same.  Assume in both cases that we did some work
up fornt and passed in some data as an object called $product.

in-line Perl (ePerl style):

<: if ($product->isbn) { :>
  It's a book!
<: } else { :>
  It's NOT a book!
<: } :>

<: foreach my $item (@{$product->related}) { :>
  You might also enjoy <: $item->name :>.
<: } :>

<: include('misc/footer'); :>

mini-language (Template Toolkit style):

[% IF product.isbn %]
  It's a book!
[% ELSE %]
  It's NOT a book!
[% END %]

[% FOREACH item = product.related %]
  You might also enjoy [% item.name %].
[% END %]

[% INCLUDE misc/footer %]

Neither one is really bad, but I think the latter is easier for someone with
no perl experience and thus no concept of references, braces, semi-colon
placement, etc.

Whatever you feel about these differences, I would not suggest trying to
fold new capabilities into Text::Template.  It's beauty is it's simplicity,
and if it doesn't do enough for you then you should be looking more
seriously at tools like Template Toolkit.

- Perrin



Reply via email to