I've been using templates in various programs for well over a year, and I'm glad to see that this is happening here. This program was a real bear to modify, and each release rquired the same mods over and over. Templates are a way of keeping the look/feel of a site but still upgrading the back end code.
One thought.
Many of the templates are very short, but they still require an I/O operation.
What about creating a "template file" for most of the short code.
This would create one I/O operation per script run, at the expense of a little memory. Most of the templates are showing up as 1K, which means you could probably realize a significant advantage by creating a HASH of template entries, then defining each entry inside a single TEMPLATES.TPL file.
While there is some thought to keeping each template in a single file, so one edit won't screw up all the other templates, there is also a significant advantage to having one file, with all the various templates defined, then each variable fleshed out.
For ultimate compatibility, if a HASH entry is NULL, then the program would look for the file on disk.
This would work for user-defined profiles as well, since which TEMPLATES.TPL file is opened could be defined by the user profile.
This would also allow one more level of abstraction. Lets say you are developing a community site. If the template parser _only_ recognized a certain set of tags and HTML commands, then a user could create their own "configuration file" and change the look of the program to suit their own tastes or needs.
Templates are an exciting programming tool, and once you start to play with them, you start to wonder how you did with out them :)
Because the TEMPLATE.TPL file would essentially be a very large "static" or "constant" definition file, it could probably be set up as a '.pm' file, and pre-loaded into apache/mod_perl so there would only be ONE instance of the program code, and no I/O operation except on start up.
The mind keeps wandering... doesn't it??