[Melbourne-pm] a perl html template processor I wrote
swatkins at fastmail.fm
Tue Apr 29 05:14:59 PDT 2008
I wrote an html template processor for a CGI/perl job,
it can do things like:
<tr bind="sql:select foo, bar from tab">
which might become:
<p>message number one</p>
<p>this is the text that
was in some_text.txt file</p>
There are two ways to get at variables, using $varname and using
bind="varname". It works with singletons, arrays, objects/hashes, plain
text and html text.
No need for loops; just bind to an array variable.
No need for conditionals; just bind to an array variable that might have
0 or 1 members.
I think it's quite a nice system, the syntax and design is simpler than
other template programs I've seen.
My CGI library also handles extra parameters on form buttons, like:
item 12: <input type="submit" name="Delete__12" value="Delete">
There's no other way to pass button-specific info with a form submit.
Is this interesting to anyone who does web development?
More information about the Melbourne-pm