RE: html tree question. clumsy ?

2003-09-25 Thread Thurn, Martin
27 PM > To: [EMAIL PROTECTED] > Subject: Re: html tree question. clumsy ? > > > Martin Thurn wrote: > > I ran into similar problems for my module WWW::Search. > > No, out-of-the-box you can not re-use an > HTML::TreeBuilder object to parse > > a new fi

Re: html tree question. clumsy ?

2003-09-24 Thread Sean M. Burke
At 09:42 AM 2003-09-23, James.Q.L wrote: 1. will $tree->parse_file(parse a new file) will overwrite the old parsed $tree content? No, don't try that. You can call parse_file on a $tree only once. As far as I remember, there's no re-using it. so that i dont have to delete the tree in the sub? W

Re: html tree question. clumsy ?

2003-09-24 Thread James.Q.L
--- Rob Dixon <[EMAIL PROTECTED]> wrote: > Martin Thurn wrote: > > I ran into similar problems for my module WWW::Search. > > No, out-of-the-box you can not re-use an HTML::TreeBuilder object to parse > > a new file. > > I'm pretty sure you're wrong about that. HTML::TreeBuilder subclasses

Re: html tree question. clumsy ?

2003-09-24 Thread Rob Dixon
James.Q.L wrote: > > Thurn, Martin wrote: > > > > I ran into similar problems for my module WWW::Search. > > No, out-of-the-box you can not re-use an HTML::TreeBuilder object to parse > > a new file. BUT you can use the following code as a "reset". I.e. call > > parse, muck with the tree, do t

Re: html tree question. clumsy ?

2003-09-24 Thread Rob Dixon
Martin Thurn wrote: > I ran into similar problems for my module WWW::Search. > No, out-of-the-box you can not re-use an HTML::TreeBuilder object to parse > a new file. I'm pretty sure you're wrong about that. HTML::TreeBuilder subclasses HTML::Parser, which provides the 'new', 'parse', 'pars

RE: html tree question. clumsy ?

2003-09-23 Thread James.Q.L
--- "Thurn, Martin" <[EMAIL PROTECTED]> wrote: > I ran into similar problems for my module WWW::Search. > No, out-of-the-box you can not re-use an HTML::TreeBuilder object to parse > a new file. BUT you can use the following code as a "reset". I.e. call > parse, muck with the tree, do the fol

RE: html tree question. clumsy ?

2003-09-23 Thread Thurn, Martin
I ran into similar problems for my module WWW::Search. No, out-of-the-box you can not re-use an HTML::TreeBuilder object to parse a new file. BUT you can use the following code as a "reset". I.e. call parse, muck with the tree, do the following four lines, and call parse again. This does the

html tree question. clumsy ?

2003-09-23 Thread James.Q.L
hi, firstly , thanks for the help from the previous post. i am trying to add html tag into html files while traversing a directory. a simple example is like my $tree = HTML::TreeBuilder->new; my $literal = HTML::Element->new('~literal','text' => $insert); ## traverse directory and insert $li