print "1..2\n"; use strict; use HTML::Parser (); my $dtext = ""; my $text = ""; sub append { $dtext .= shift; $text .= shift; } my $p = HTML::Parser->new(text_h => [\&append, "dtext, text"], default_h => [\&append, "text, text" ], ); my $doc = <<'EOT'; ååAA<A>AA &xyzzy &xyzzy;  ÿ � � & &aring å EOT $p->parse($doc)->eof; print "not " unless $text eq $doc; print "ok 1\n"; print $dtext; print "not " unless $dtext eq <<"EOT"; print "ok 2\n"; ċċAAAA &xyzzy &xyzzy; \1 \377 � � & &aring ċ EOT