http://qs321.pair.com?node_id=146089

munchie has asked for the wisdom of the Perl Monks concerning the following question:

On page 110 in the Learning Perl (3rd Edition)(2nd footnote):
These examples are intentionally not HTML, because there are too many tricks things that crop up in real HTML, or any similar language like XML or SGML. If you need to work with HTML, don't use simple patterns like these. Get a rhobust module from CPAN, so that you can start with code that's already written and debugged. If you don't, we promise that you'll be sorry. Don't say we didn't warn you.

My question is simply: Is there a particular module they had in mind (merlyn... :-) ), and if not, any recommendations for good HTML modules?

> munchie, the number munchin newb
Llama: The other other white meat!
(you had to be there :-P)

  • Comment on Question about footnote in the Llama book

Replies are listed 'Best First'.
Re: Question about footnote in the Llama book
by dvergin (Monsignor) on Feb 18, 2002 at 03:56 UTC
    As Kanji says, HTML::Parser is the most common choice for parsing HTML.

    Another option that is good in some situations is HTML::TokeParser which uses a different (and some say easier) approach.

    HTML::TableExtract is also handy for the more specific task of grabbing text from HTML tables.
     

Re: Question about footnote in the Llama book
by chipmunk (Parson) on Feb 18, 2002 at 04:25 UTC
    Another useful module for parsing HTML is HTML::TreeBuilder. I like this module because it parses the whole document at once, and then returns a nicely structured tree that you can walk. It's a different approach from the other common HTML parsing modules.
Re: Question about footnote in the Llama book
by Kanji (Parson) on Feb 18, 2002 at 03:03 UTC

    I don't have a recent edition of the Llama, but if you're referring to HTML parsing then you'll want to take a look at HTML::Parser (alt.).

        --k.


Re: Question about footnote in the Llama book
by jerrygarciuh (Curate) on Feb 18, 2002 at 03:54 UTC
    Well the most obviously useful module for creating HTML is CGI.pm . I am currently reading the 2nd ed. of the Mouse book, and it is great (esp. as compared to 1st ed. which is way outdated).

    You might also want to read this thread which has quite a bit of discussion of the templating modules HTML::Mason and HTML::Template.

    HTH,
    jg
    _____________________________________________________
    It's not my tree.
Re: Question about footnote in the Llama book
by tachyon (Chancellor) on Feb 18, 2002 at 20:46 UTC

    For some HTML::Parser example scripts use the Super Search form I have pre-filled in for you here

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print