use strict; use warnings; use HTML::Strip; my $html = .....; my $hs = HTML::Strip->new(); my $clean_text = $hs->parse( $html ); $hs->eof; print $clean_text;