use HTML::Template::Compiled; my $htc = HTML::Template::Compiled->new( scalarref => \'<%include_string foo %>', ); $htc->param( foo => "<%= bar %>", bar => 23, ); print $htc->output; __END__ 23