my $htmltext; my $p = HTML::Parser->new ( api_version => 3, text_h => [sub {$htmltext .= join "",@_;}, 'text'], ); $p->parse($htmlcode) or warn "could not parse $link: $!"; print $htmltext;