If you're using the latest versions of CGI, they produce valid XHTML. I seriously doubt those will validate as HTML 2.0 (IIRC, we're on HTML 4.1 now). In fact, the programmer has very little control over the HTML that CGI generates. Actually, if you really want to get into it, the Web pages themselves render properly, but aren't valid. I worked like mad trying to put that thing together and now have so many other projects going on that I can't seem to get back to it.

I tried running the pages through HTML Tidy at one point, but that seriously broke all of the CSS. Since I've not found any browsers that the pages break, I elected to move on to more pressing matters. If you don't want XHTML, you can check to see if the pages validate with the following use statement:

use CGI qw/-no_xhtml/;

And to answer your question about the wisdom of conforming to W3C standards: this is a Good Thing. If people keep ignoring standards, the Web will be an even worse place than it already is. Heck, the latest IE security hole (having executables silently download and run just by visiting the Web site) is a direct result of MS ignoring the standards -- probably with the intent of having other browsers break on MS only Web sites.

Further, if your HTML validates as W3C compliant, this doesn't guarantee that it will render exactly as you expect, but it's one heck of a lot more likely to do so.

Hope that helps! (and thanks for the plug :)

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Re: CGI.pm HTML vs. W3C HTML Validation by Ovid
in thread CGI.pm HTML vs. W3C HTML Validation by jlongino

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.