http://qs321.pair.com?node_id=655958


in reply to Abstracting away layout details when using large HTML::Template-based sites?

There is HTML::Template::Compiled which, while being compatible to HTML::Template, has a dynamic include feature, which does exactly what you expected above from HTML::Template at this point.

Referring to your code above:

my $filename = "./page.inc"; # or determine dynamically $layout->param( page => $filename );

layout.tmpl

<html> <head> <title><!-- tmpl_var name='title' --></title> </head> <body> <!-- tmpl_include_var name='page' --> </body> </html>

and title will also be expanded in the page.inc part.