in reply to Reading in html files help!
This assumes the two files header.tmpl and footer.tmpl exist.
#!/usr/bin/perl use warnings; use strict; use HTML::Template; my $t = HTML::Template->new(filehandle => *DATA); print $t->output; __DATA__ <html> <head> <title>Simple Test</title> </head> <body> <TMPL_INCLUDE NAME="header.tmpl"> <div class=menu> ...stuff... </div> <div class=main> <!--content--> </div> <TMPL_INCLUDE NAME="footer.tmpl"> </body> </html>
<html> <head> <title>Simple Test</title> </head> <body> home - about - services - etc <div class=menu> ...stuff... </div> <div class=main> <!--content--> </div> its all about service etc </body> </html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading in html files help!
by Anonymous Monk on Apr 22, 2010 at 14:59 UTC |