in reply to CGI.pm HTML vs. W3C HTML Validation

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.