use YAPE::HTML; my $parser = YAPE::HTML->new("..."); while (my $chunk = $parser->next) { print $chunk->text if $chunk->type eq 'text' }