"Brian Raven" <[EMAIL PROTECTED]> writes:

> > If what you want is to feed the parser the document in chunks 
> > until you have extracted enough text, then I suggest you use 
> > the HTML::Parser class directly.  The HTML::TokeParser 
> > assumes you are able to give it the whole document when it is created.
> 
> But isn't that what pretty much HTML::PullParser (from which
> HTML::TokeParser is derived) actually does? Its get_token method calls
> HTML::Parser->parse on 512 byte chunks of the input document, using
> read() or substr() as appropriate, until it has collected one or more
> tokens.

The difference is that with PullParser it's calling out to grab the
next chunk while with the base HTML::Parser you provide the chunks
directly and the parser reacts.  It would be possible to pass your own
tied file handle to PullParser where you generate content lazily as
the parser reads, but it will usually be less convoluted to use the
HTML::Parser and simply call the parse($chunk) method yourself.

Regards,
Gisle
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to