I have an HTML file with comments like:
<!-- cgi:SOMETHING -->
I want to parse that file under two conditions. The first condition will replace those comments with data like($buffer contains the entire HTML file):
$buffer =~ s/<!-- cgi:SOMETHING -->/$my_data/g;
The other instance of parsing this file get rid of those comments alltogether. So I want to parse $buffer and anywhere it sees a comment, it replaces it with nothing. However, the SOMETHING in the comment will be different for each comment, so how would I write the substitution command to replace all comments with nothing?