use HTML::Parser; HTML::Parser->new( unbroken_text => 1, default_h => [sub { print shift }, 'text'], text_h => sub { my $text = shift; (URI::Find here); print $text }, 'text'], )->parse_file(shift || die) || die $!;