use Template; my $t = Template->new(   INCLUDE_PATH => '.',   PRE_PROCESS  => 'main.tmpl' ) or die $!; open my $fh, '<', 'index.tmpl' or die $!; my $template = do { local $/; <$fh> }; close $fh; while ( sleep 1 ) {   $t->process(\$template) or die $!; }