in reply to Re^2: Many matches to an array
in thread Many matches to an array

Yes, absolutely. And nested divs. And shed loads of whitespace. Which makes the regex route, IMHO, even more scary.
I was attempting to make a point with a simple case. But, as you point out, it was probably more misleading than helpful.
I must have a look at HTML::Parser. It appears to be the parser of choice 'round these parts.
Thanks, wfsp

Replies are listed 'Best First'.
Re^4: Many matches to an array
by tachyon (Chancellor) on Jul 15, 2004 at 14:23 UTC

    HTML::TokeParser is just a wrapper on top of HTML::Parser. The example I gave is in API 2 callback style. You can also use the API 3 style new constructor but I find it is not really as clear. That bit of logic - increment a counter on open tag, decrement on close, print if counter on, don't if not, and fix the comments gets you a lot of mileage..... Toke::Parser is far easier to use, and much more pleasing to the eye but you loose some of the full power of Parser.

    cheers

    tachyon