print "1..3\n";
use strict;
use HTML::Parser;
my $p = HTML::Parser->new(api_version => 3);
$p->report_tags("a");
my @doc;
$p->handler(start => \&a_handler, "skipped_text, text");
$p->handler(end_document => \@doc, '@{skipped_text}');
$p->parse(<eof;
hi
and some text.
EOT
sub a_handler {
push(@doc, shift);
my $text = shift;
push(@doc, uc($text));
}
print "not " unless join("", @doc) eq <<'EOT'; print "ok 1\n";
hi
and some text.
EOT
#
# Comment stripper. Interaction with "" handlers.
#
my $doc = <text