3 # This program will print out the title of an HTML document.
11 $self->handler(text => sub { print @_ }, "dtext");
12 $self->handler(end => "eof", "self");
15 my $p = HTML::Parser->new(api_version => 3,
16 start_h => [\&title_handler, "self"],
17 report_tags => ['title'],
19 $p->parse_file(shift || die) || die $!;