in reply to Comment Removal
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";
|
|---|