[PATCH]HTML-Tree-0.51_mac-1
Michael A. Chase (mchase@ix.netcom.com)
Tue, 14 Dec 1999 21:08:40 -0800
------=_NextPart_000_005D_01BF4677.65834EE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Here's a patch that will let HTML::Treebuilder work for now.
Gisle,
It looks like we need to add an initializer to HTML::Parser or HTML::Element
to allow one to initialize objects of the other's class. Adding the
initializer to HTML::Element would probably be easier.
Do we have a memory leak when a reblessed reference to a HTML::Parser object
is reassigned?
--
Mac :})
** I may forward private database questions to the DBI mail lists. **
----- Original Message -----
From: Randal L. Schwartz <merlyn@stonehenge.com>
To: Gisle Aas <gisle@aas.no>
Cc: <libwww@perl.org>
Sent: 14 December, 1999 19:47
Subject: Re: HTML-Parser-3.00
> Hmm. "make test" on HTML::Tree's distribution now reports:
>
> t/oldparse..........Can't find '_hparser_xs_state' element in
HTML::Parser hash at blib/lib/HTML/Parse.pm line 144.
>
> ooops. :)
>
> This means that installing HTML::Parser 3.0 breaks anything that
> uses HTML::TreeBuilder, including my cute html2cgi script from my
> Perl-WT column.
------=_NextPart_000_005D_01BF4677.65834EE0
Content-Type: application/octet-stream;
name="HTML-Tree-0.51_mac-1.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="HTML-Tree-0.51_mac-1.patch"
# Temporary fix for HTML::TreeBuilder inheiritance from HTML::Parser
# From Michael A. Chase, mchase@ix.netcom.com
#=20
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -ub 'old\HTML-Tree-0.51\lib\HTML\TreeBuilder.pm' =
'new\HTML-Tree-0.51\lib\HTML\TreeBuilder.pm'
Index: ./lib/HTML/TreeBuilder.pm
--- ./lib/HTML/TreeBuilder.pm Tue Dec 14 20:28:20 1999
+++ ./lib/HTML/TreeBuilder.pm Tue Dec 14 20:55:14 1999
@@ -123,7 +123,13 @@
{
my $class =3D shift;
my $self =3D HTML::Element->new('html'); # Initialize =
HTML::Element part
- $self->{'_buf'} =3D ''; # The HTML::Parser part of us needs this
+
+ # Copy HTML::Parser attributes into current object
+ my $hp =3D HTML::Parser->new();
+ foreach ( keys %$hp ) {
+ $self->{$_} =3D $hp->{$_};
+ }
+ $self->{_hparser_obj} =3D $hp; # keep HTML::Parser object alive
=20
# Initialize parser settings
$self->{'_implicit_tags'} =3D 1;
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Tue Dec 14 20:56:31 1999
# Generated by : makepatch 2.00_03
# Recurse directories : Yes
# Excluded files : (\A|.*/)CVS(/.*|\Z)
# (\A|.*/)RCS(/.*|\Z)
# ,v\Z
# (\A|.*/)SCCS(/.*|\Z)
# (\A|.*/)[sp]\..+\Z
# p 'lib/HTML/TreeBuilder.pm' 8955 945233714 037777700600
#### End of ApplyPatch data ####
#### End of Patch kit [created: Tue Dec 14 20:56:31 1999] ####
#### Patch checksum: 36 1331 27799 ####
#### Checksum: 55 2067 23802 ####
------=_NextPart_000_005D_01BF4677.65834EE0--