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.


In reply to (Ovid) Re: (2): RFC: HTML::TokeParser::Easy by Ovid
in thread RFC: HTML::TokeParser::Easy by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.