Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • (A point where I diverge from HTML::TokeParser's approach is that I have tokens be actual objects, with accessors, not just bare arrayrefs.)

    Never having been a fan of HTML::TokeParser's arrayrefs, I wrote HTML::TokeParser::Simple [cpan.org]. It provides the accessor methods I wanted and makes the code much easier to read. Want to know if a token is a starting or ending form tag? With HTML::TokeParser, you do this:

        if( ('S' eq $token->[0] or 'E' eq $token->[0]) and 'form' eq $token->[1] ) {

    Now, you can do this:

        if ( $token->is_tag( 'form' ) ) {

    Heck, you can leave the 'form' off to get a boolean response on whether or not something is a tag. There are many useful methods, it makes HTML parsing an almost trivial affair, and I have no idea if anyone is using the darn thing. That's a somewhat deflating aspect of being a CPAN author. Aside from the occasional bug report, who knows if you've helped anyone? I've had some thoughts of other things I'd like to do with that module, but I don't want to spend a lot of time one something that no one will ever use.