Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.220.196.68
#!/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";
|