http://www.perlmonks.org?node_id=655964


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

I would also suggest HTML::Template::Compiled, but your filter solution is pretty nice too. You can work around the ENV variable by building a filter based on the variable, using an embedded sub:
sub mk_include_filter { my $page = shift; return sub { my $text_ref = shift; $$text_ref =~ s/###/$page/g; }; } my $template = HTML::Template->new(filename => 'layout.tmpl', filter => mk_include_filter('page.i +nc') );