Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I, too, used to think like Grumpy old Leon. I've used lots of templating libraries and often wished for a better solution but kept being disappointed with the latest template library released to CPAN. Petal is a different beast than the typical search-and-replace library.

    The template attribute language (TAL) is a great solution for mini-language templates (see Perrin's Choosing a Template Language []), and Jean-Michel has done an admirable job of creating a module that implements this functionality in Perl. It plays nicely with the GUI editors which my designers like to subject my templates to, it doesn't generate too many errors when scanned with HTML Tidy, and my templates look cleaner than when using custom html tags.

    BTW, Perrin has told Jean-Michel that he plans to cover Petal in his next update of that article. Furthermore, if you use TT2, HTML::Template or Text::Template and pass a hash reference to these templates, it's relatively easy to convert your existing templates to Petal without many changes to your existing Perl code.

    Try it! Like me, you might find it's going to become a best of breed solution for implementing HTML/XML templates.