use strict; use warnings; my $string = <<'HTML'; <# Just data #> >>>>>>>>>>> ]]> HTML $string =~ s/<.+?>//g; print $string;