use HTML::TagFilter; my $tf = new HTML::TagFilter->new( allow => {}, strip_comments => 1, ); my $text = $tf->filter($html);