develooper Front page | perl.libwww | Postings from September 2001

Small buglet in HTML::HeadParser

Ed .
September 14, 2001 08:21
Small buglet in HTML::HeadParser
Message ID:
Hi everyone,

In this section (lines 163-167) of HTML::HeadParser:

	if (!defined $key) {
	    return unless $attr->{'name'};
	    $key = "X-Meta-\u$attr->{'name'}";
	$self->{'header'}->push_header($key => $attr->{content});

it seems that the problem the "if" block is intended to fix is incompletely 
addressed. Specifically, if there is HTML like this:

<META HTTP-EQUIV="" NAME="Author" CONTENT="Some People, Inc.">

Then the whole process will grind to a halt (and cause ActivePerl 5.6.1 on 
Win2k to issue a scary message saying a location couldn't be read!). The 
problem was solved here by changing the first line of the block to:

	if (!$key) {

which seems to preserve the original intent.


p.s. I am not on the list, so please Cc: me if you have any questions.

Get your FREE download of MSN Explorer at Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About