Skip Menu |
 

This queue is for tickets about the HTML-Parser CPAN distribution.

Report information
The Basics
Id: 4065
Status: rejected
Priority: 0/
Queue: HTML-Parser

People
Owner: Nobody in particular
Requestors: blair [...] orcaware.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.31
Fixed in: (no value)



Subject: t/tokeparser failure in 3.32 with Perl 5.004
Download (untitled) / with headers
text/plain 1.8k
Hi Gisle, I'm only reporting this bug because HTML::Parser passed make test fine with HTML::Parser 3.31 using Perl 5.004 (an impressive feat to keep this Perl supported for so long). Now with HTML::Parser 3.32, I get this: t/textarea...........ok t/tokeparser.........Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52. Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52. t/tokeparser.........FAILED test 8 Failed 1/8 tests, 87.50% okay BTW, Perl 5.005 passes make test just fine with 3.32. Best, Blair % /opt/i386-linux/installed/perl-5.004_05/bin/perl -V Summary of my perl5 (5.0 patchlevel 4 subversion 5) configuration: Platform: osname=linux, osvers=2.4.18-5, archname=i686-linux uname='linux orcaware.com 2.4.18-5 #1 mon jun 10 15:31:48 edt 2002 i686 unknown ' hint=recommended, useposix=true, d_sigaction=define bincompat3=n useperlio=undef d_sfio=undef Compiler: cc='gcc', optimize='-O3', gccversion=3.1.1 cppflags='-Dbool=char -DHAS_BOOL' ccflags ='-Dbool=char -DHAS_BOOL' stdchar='char', d_stdstdio=undef, usevfork=false intsize=4, longsize=4, ptrsize=undef, doublesize=undef alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='gcc', ldflags ='' libpth=/lib /usr/lib libs=-lnsl -lgdbm -ldl -lm -lc -lcrypt libc=/lib/libc-2.2.5.so, so=so useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared' Characteristics of this binary (from libperl): Built under linux Compiled at Aug 7 2002 11:02:36 @INC: /opt/i386-linux/installed/perl-5.004_05/lib/i686-linux/5.00405 /opt/i386-linux/installed/perl-5.004_05/lib /opt/i386-linux/installed/perl-5.004_05/lib/site_perl/i686-linux /opt/i386-linux/installed/perl-5.004_05/lib/site_perl .
Download (untitled) / with headers
text/plain 1.2k
Show quoted text
> I'm only reporting this bug because HTML::Parser passed make test fine > with HTML::Parser 3.31 using Perl 5.004 (an impressive feat to keep > this > Perl supported for so long). Now with HTML::Parser 3.32, I get this: > > t/textarea...........ok > t/tokeparser.........Use of uninitialized value at > blib/lib/HTML/TokeParser.pm line 52. > Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52. > t/tokeparser.........FAILED test 8 > Failed 1/8 tests, 87.50% okay
I don't really understand this yet, but this patch makes the test pass on perl-5.004. Index: lib/HTML/TokeParser.pm =================================================================== RCS file: /cvsroot/libwww-perl/html-parser/lib/HTML/TokeParser.pm,v retrieving revision 2.26 diff -u -p -r2.26 TokeParser.pm --- lib/HTML/TokeParser.pm 10 Oct 2003 10:45:46 -0000 2.26 +++ lib/HTML/TokeParser.pm 11 Oct 2003 20:04:42 -0000 @@ -64,7 +64,7 @@ sub get_text my $self = shift; my @text; while (my $token = $self->get_token) { - my $type = $token->[0]; + my $type = "$token->[0]"; if ($type eq "T") { my $text = $token->[1]; decode_entities($text) unless $token->[2]; Without this the assigment to $type have the side effect of making $token->[0] undef. Very strange.
[GAAS - Sat Oct 11 16:09:12 2003]: Show quoted text
> > I'm only reporting this bug because HTML::Parser passed make test fine > > with HTML::Parser 3.31 using Perl 5.004 (an impressive feat to keep > > this > > Perl supported for so long). Now with HTML::Parser 3.32, I get this: > > > > t/textarea...........ok > > t/tokeparser.........Use of uninitialized value at > > blib/lib/HTML/TokeParser.pm line 52. > > Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52. > > t/tokeparser.........FAILED test 8 > > Failed 1/8 tests, 87.50% okay
> > I don't really understand this yet, but this patch makes the > test pass on perl-5.004. > > Index: lib/HTML/TokeParser.pm > =================================================================== > RCS file: /cvsroot/libwww-perl/html-parser/lib/HTML/TokeParser.pm,v > retrieving revision 2.26 > diff -u -p -r2.26 TokeParser.pm > --- lib/HTML/TokeParser.pm 10 Oct 2003 10:45:46 -0000 2.26 > +++ lib/HTML/TokeParser.pm 11 Oct 2003 20:04:42 -0000 > @@ -64,7 +64,7 @@ sub get_text > my $self = shift; > my @text; > while (my $token = $self->get_token) { > - my $type = $token->[0]; > + my $type = "$token->[0]"; > if ($type eq "T") { > my $text = $token->[1]; > decode_entities($text) unless $token->[2]; > > Without this the assigment to $type have the side effect > of making $token->[0] undef. Very strange.
I am seeing this exact error with perl version 5.005_02 built for sun4-solaris. If you look at the token array, you'll see that in fact the first 2 elements are undef when they should not be. For instance, in the following case I believe token->[1] should be 'img' but is undef: DB<5> x $token 0 ARRAY(0x34fd7c) 0 undef 1 undef 2 HASH(0x34fce0) 'alt' => 'Perl' 'src' => 'camel.gif' 3 ARRAY(0x3ddf44) 0 'src' 1 'alt' 4 '<img src="camel.gif" alt="Perl">' It looks like the problem occurs when parsing the HTML and building the token array. This doesn't appear to be a problem in later releases of perl. id2001@cablelabs.com
At this point I think I just declare those old perls as unsupported :-(
At this point I think I just declare those old perls as unsupported :-(


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.