in reply to
Re: html template in a perl script
in thread html template in a perl script
I wasn't planning on making one template for EVERY script, but it does come in handy in many instnaces. For instance I have a lot of utility scripts for editing Berkeley Databases and various other things. These scripts are created as a drop in solution and can often end up just about anywhere. The HTML for these scripts never really changes. All a template really does is adds another thing to cart around with the script.
If you're creating a dynamic page where multiple pages need to retain the same look, then sharing similar templates makes sense. I do what you do quite often with multiple parts, but usually I use server side includes to call perl content. I'm pretty picky on performance, so I often find it's better to have cron run scripts to generate "static" content, or just have a perl script generate "static" content for each change. You can slightly improve security by this method by moving scripts out of harms (hackers) way.
I've never been the sort of guy to make an entire website have a single look, mainly just by section so often I end up designing many more templates. Cutting these pages apart gives you flexibility, but having four template parts gets really messy when you're talking going six html tables deep and spanning multiple template files.
This is often more of an issue with an associate of mine who isn't so CGI oriented. He has a bad habbit of seeing an html page (template) and linking that instead of the CGI script and only later looks at it and sees there's no conetent!