For generating HTML, I like a combination of HTML::Template and HTML::FromText, the latter of which I nearly have a nifty patch for. Real soon now, I promise! :-)

In general, I detest writing HTML, and would prefer to have the computer do it for me. If I want a loosely formatted document, HTML::FromText does an excellent job; otherwise, latex2html is preferred. On the other hand, neither tool produces particularly pretty markup, and I don't mind because I'm one of those archaic elitists who prefer content over eye candy. If you want a pretty site, you're probably best off embedding generated HTML in a template. (I have an example at http://www.infernus.net/; a somewhat old version of the code is listed at Automating a Static Website.)

For parsing HTML, use HTML::Parser; for intelligently parsing pseudo-HTML, have a look at Why I like functional programming.

--
The hell with paco, vote for Erudil!
:wq


In reply to Re: How do you deal with HTML in Perl? by FoxtrotUniform
in thread How do you deal with HTML in Perl? by blokhead

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.