#!/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";
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
hanchors | File | 1.11 KB | 0644 |
|
hdump | File | 541 B | 0644 |
|
hform | File | 1.8 KB | 0644 |
|
hlc | File | 547 B | 0644 |
|
hrefsub | File | 2.72 KB | 0644 |
|
hstrip | File | 1.67 KB | 0644 |
|
htext | File | 548 B | 0644 |
|
htextsub | File | 788 B | 0644 |
|
htitle | File | 434 B | 0644 |
|