in reply to Comment Removal

One method I've used is to use this for comments in my HTML files:
<!--Section CONTENT-->
And then replace that with what's inside the comment tags with this:
$template =~ s/<!--Section (.+?)-->/$1/sg;