It's not clear to me exactly what problem you're trying to
solve, but the idea is interesting. It's true that HTML::Parser
and friends can be slow. However, I'm sure you're aware of the
difficulty of parsing markup correctly. Basically, for something
like this there's a tradeoff between speed and generality;
my guess is that you could put together something much faster
that served your particularly purpose here, but wouldn't scale
or solve much else.
in reply to A grammar for HTML matching
In other words, I can't tell if you're just looking for something
faster than HTML::Parser or Parse::RecDescent, or you have a
different generalized approach in mind.
Finally, if you haven't seen HTML::TreeBuilder, take a look
at that. My guess is that you know about it and would consider
it too slow as well, but just in case, there it is.