in reply to Comment Removal

Your substitution looks for <-- (you might have wanted <!--) and then matches a single character that's not > or <, followed by -->. Probably not what you want.

A simple approach (although by no means 100% reliable) would be

$question =~ s/<!--.*?-->//sg;

To reliably remove comments from HTML, use HTML::Parser or a related module.

Or, even fancier, use File::Comments:

#!/usr/bin/perl -w use strict; use File::Comments; my $stripper = File::Comments->new(); my $stripped = $stripper->stripped("foo.html"); print "$stripped\n";