%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /usr/share/doc/perl-HTML-Parser/eg/ |
Upload File : |
#!/usr/bin/perl
# This program will print out the title of an HTML document.
use strict;
use HTML::Parser ();
sub title_handler
{
my $self = shift;
$self->handler(text => sub { print @_ }, "dtext");
$self->handler(end => "eof", "self");
}
my $p = HTML::Parser->new(api_version => 3,
start_h => [\&title_handler, "self"],
report_tags => ['title'],
);
$p->parse_file(shift || die) || die $!;
print "\n";