open(TEMPLATE, "template.html") or die $!;
my $xtemplate = join '', ;
close (TEMPLATE);
# your markers
my @markers = qw(TITLE STUFF);
# your replacement values, arrayisized (ITS A WORD I TELL YOU!)
my @replace = qw(meep narf);
$xtemplate =~ s/\*{4}$markers[$_]\*{4}/$replace[$_]/g
for (0 .. $#markers);
# your formatted result
print $xtemplate;