1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use Test::More tests => 2; use strict; use HTML::Parser; my @start; my @text; my $p = HTML::Parser->new(api_version => 3); $p->handler(start => \@start, '@{tagname, @attr}'); $p->handler(text => \@text, '@{dtext}'); $p->parse(<<EOT)->eof; Hi <a href="abc">Foo</a><b>:-)</b> EOT is("@start", "a href abc b"); is(join("", @text), "Hi\nFoo:-)\n");