my $p = HTML::Parser->new( api_version => 3, text_h => [ sub {print shift}, "dtext" ], ); $p->parse_file('somefile.html') || die "could not parse HTML file\n";