in reply to Poorly written script
There are literally hundreds of posts related to templating here, as a simple search will reveal. Be also sure to read the Choosing a Templating System, (perl.com article).