# this first bit is right out of the HTML::Parser perldoc
sub title_handler {
return if shift ne "title";
my $self = shift;
$self->handler( text => sub { $j::title = shift }, "dtext" );
$self->handler(
end => sub { shift->eof if shift eq "title"; },
"tagname,self"
);
}
sub date_handler {
return if shift ne "date";
my $self = shift;
$self->handler( text => sub { $j::date = shift }, "dtext" );
$self->handler(
end => sub { shift->eof if shift eq "date"; },
"tagname,self"
);
}
####
sub insertFile {
my $file = shift;
my $p = HTML::Parser->new( api_version => 3 );
$p->handler( start => \&title_handler, "tagname,self" );
$p->handler( start => \&date_handler, "tagname,self" );
$p->parse_file($file);
.................