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

Small buglet in HTML::HeadParser

From:
Ed .
Date:
September 14, 2001 08:21
Subject:
Small buglet in HTML::HeadParser
Message ID:
F1329bZx53IN3w6b3ls000109ef@hotmail.com
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.

Regards,
Ed

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 http://explorer.msn.com/intl.asp




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About