in reply to (crazyinsomniac : a request) Re: RFC: HTML::TokeParser::Easy
in thread RFC: HTML::TokeParser::Easy
Hey, the hash functionality looks interesting. I'll keep that in mind. I'll look at how it's organized now to see how I could implement that.
As for the AUTOLOAD, I'm typically a B&D programmer. The only reason I chose that route is to make maintenance easier. Once it is structured correctly, if more stuff is added to HTML::TokeParser, I just add it to the hash and the methods are auto-generated. If people think that this is too serious an objection, I can take it out.
As for AUTOLOAD slowing things down, I don't think it does (though I haven't benchmarked it). In my experience, people really only use a few of the array elements from HTML::TokeParser. In this module, those elements translate to methods and once generated, they are added to the symbol table and the overhead is gone. Even if you called every method generated, you would probably add less than a second to the total runtime of the program (and if you called every method, than you have a huge program and that second is meaningless).
Anyone else think that the AUTOLOAD should go?
Cheers,
Ovid
P.S.: Thanks for the feedback :)
Update: Now that I think about it, the AUTOLOAD can be simplified by having the two overloaded (is_(start|end)_tag) functions moved into their own methods. Everything else is identical, though. Hmm... maybe it should go.
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|