in reply to
Re: php style includes
in thread php style includes
How about HTML::Template
Agreed. If you use HTML::Template, you can use include statements within your HTML documents. Something like this could go in your index.html (or where ever):
<html>
<body>
<tmpl_include="templates/top.html">
<tmpl_include="templates/left.html">
<tmpl_include="templates/main.html">
<tmpl_include="templates/bottom.html">
</body>
</html>
In your Perl code, you would just say:
<code>
use HTML::Template();
# open the html template
my $template = HTML::Template->new(filename => 'index.html');
# Fill in various parameters here
...
# Send header here
...
# print the template
print $template->output;
The documentation for this module is very good, just read up on it for instructions on what all you can do with it.
-Eric