HTML::...te::Pro(3pm)

πŸ‘‘ HTML::Template::Pro β€” the manpage, bestie edition

okay so you opened the manual for HTML::Template::Pro (that's the HTML::...te::Pro(3pm) one, yeah, the name got squished in the header, but it's her) and I'm gonna walk you through it like we're texting at 2am. every single fact is staying, I'm just making it cute. πŸ’–

🌸 NAME 🌸

HTML::Template::Pro β€” a Perl/XS module to use HTML templates from CGI scripts. that's it, that's the whole thing, she's a template engine and she is fast. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

so the synopsis? it got moved out and split up, like a group project. 😭

  • for the intro to HTML::Template and the syntax of template files, go read "SYNOPSIS" in HTML::Template::SYNTAX.
  • for the perl interface of HTML::Template, HTML::Template::Expr and HTML::Template::Pro, go read "SYNOPSIS" in HTML::Template::PerlInterface.

that's your reading list, bestie, no shortcuts. πŸŽ€


πŸ’… DESCRIPTION πŸ’…

original HTML::Template was written by Sam Tregar, sam@tregar.com, with contributions from a whole crowd of people who are mentioned over there. their collective effort turned HTML::Template into a mature html template engine that separates perl code from html design. iconic behaviour, truly. πŸ‘‘

but here's the tea: as powerful as HTML::Template is, she is slow. especially if mod_perl isn't available, or if you're dealing with disk usage and memory limitations. it's giving... limited. πŸ’€

HTML::Template::Pro is a fast, lightweight C/Perl+XS reimplementation of HTML::Template (as of 2.9) and HTML::Template::Expr (as of 0.0.7). she is not intended to be a complete replacement, she's meant to be a fast implementation of HTML::Template for when you don't need querying or the extended facility of HTML::Template. designed for heavy upload, resource limitations, and absence of mod_perl. main character energy under pressure. πŸ”₯

she has complete support of filters and HTML::Template::Expr's tag EXPR="<expression>", including user-defined functions, plus the construction <TMPL_INCLUDE EXPR="...">. obsessed. πŸ’–

HTML::Template's work cycle uses 2 steps. first, it loads and parses the template. then it accepts param() calls until you call output(). output() is its second phase, where it produces a page from the parsed tree of the template it got in the 1st step.

HTML::Template::Pro loads, parses and outputs the template on the fly, when you call $tmpl->output(), in one pass. the corresponding code is written in C and glued to Perl using Perl+XS. as a result, compared to HTML::Template in ordinary calls, she runs 10-25 times faster. and compared to HTML::Template with all caching enabled under mod_perl, she's still 1-3 times faster. slay. ✨

and here's the part that really ate: HTML::Template caching requires a considerable amount of memory (per process, shareable, or on disk) to be permanently filled with parsed trees, whereas HTML::Template::Pro doesn't consume memory for caches and uses mmap() for reading templates on disk. no bloat, just vibes. 🧚

the introduction to HTML::Template and the syntax of template files is described in HTML::Template::SYNTAX. the perl interface of HTML::Template and HTML::Template::Pro is described in HTML::Template::PerlInterface.


πŸ”₯ SEE ALSO πŸ”₯

  • HTML::Template::SYNTAX
  • HTML::Template::PerlInterface

the Progect page is http://html-tmpl-pro.sourceforge.net (and http://sourceforge.net/projects/html-tmpl-pro)

the original modules are HTML::Template and HTML::Template::Expr. their progect page is http://html-template.sourceforge.net


πŸ’€ BUGS πŸ’€

go read "BUGS" in HTML::Template::PerlInterface, bestie. that's where the drama lives. πŸ™ˆ


🫢 AUTHOR 🫢

I. Vlasenko, <viy@altlinux.org>

with contributions of:

  • Bruni Emiliano, <info at ebruni.it>
  • Stanislav Yadykin, <tosick at altlinux.ru>
  • Viacheslav Sheveliov <slavash at aha.ru>
  • Shigeki Morimoto <shigeki.morimoto at mixi.co.jp>
  • Kirill Rebenok <kirill at rebenok.pl>

shoutout to the whole squad, couldn't have done it without y'all. 🌈


Copyright (C) 2005-2021 by I. Yu. Vlasenko. pieces of code in Pro.pm and documentation of HTML::Template are copyright (C) 2000-2002 Sam Tregar (sam@tregar.com)

the template syntax, interface conventions and a large piece of documentation of HTML::Template::Pro are based on the CPAN module HTML::Template by Sam Tregar, sam@tregar.com.

this library is free software; you can redistribute it and/or modify it under either the LGPL2+ or under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

licensing note bestie: it's the LGPL2+ or same-as-Perl, your choice, and "any later version of Perl 5" is doing a lot of heavy lifting here. read it properly, don't just skim. πŸ’œ

aaaand that's the whole page, we're done! this was perl v5.42.3, dated 2026-08-19, and honestly? she understood the assignment. mwah. πŸ’…πŸ’–

πŸ“¦ where this page comes from