http://www.perlmonks.org?node_id=52521


in reply to MTV

The HTML produced by this code generates a host of interesting errors when run through a validator. The first one is a DTD declaration (the second one in the document) inside the <head>...</head>. (comments based on sample output available at the link)

Replies are listed 'Best First'.
Re: Re: Merlyn Technique Viewer
by epoptai (Curate) on Jan 18, 2001 at 06:51 UTC
    You say this code generates "a host of interesting errors when run through a validator" followed by "comments based on sample output available at the link".

    Had you validated the output of the script you would have seen that it didn't generate the sample, a much earlier revision did. I neglected to update the sample because it wasn't as important to me as the code. After all it was only a sample, nothing i expected anyone to bother validating and criticizing on PERLmonks!

    Next time please run the perl code before running off to the HTML validator.

    And if you're really worried about a 5 space alignment variation in lynx (how nit picky can you get?) try looking at the source code to find out why it does that, and fix your copy, if you actually use lynx and can't live with it. I gave you the code for free, it's the least you could do.

    Update: I changed this node when i realized how ridiculous the criticism was. Apologies to davorg for eliminating the context of his reply.
      ...you forgot to mention that these html errors are pretty much irrelevant since they don't interfere with rendering the document in a web browser, where most people will be using them.

      When Netscape (and later Microsoft) decided that their browsers were going to be lenient on pages that did not contain valid HTML, I wonder if they realised what a huge can of worms they were opening. The vast majority of the web is now made up of badly constructed pages of invalid HTML.

      When taken to task on this, the author's generally argue my that same way as you have, "but it works in both (sic) browsers" or "I'm not interested in the minority who use 'non-standard' browsers". Leaving aside the fact that there aren't just two browsers (and that there are many different versions of even the major two) and also the fact that there's no way that Netscape or IE can be described as 'standard' with any meaningful use of the term - there are two major flaws in this argument:

      • In my experience, it's just as easy to create standard HTML as it is to create non-standard HTML. This is particularly true if you're using something like CGI.pm to create your HTML.
      • Maybe now, most of your visitors are coming from Win32 PCs using IE5 or Netscape 4.x, but this situation is changing fast. The number of people surfing from Linux boxes is increasing all the time - and they have a much wider range of browsers to choose from. Also, what about the growing numbers of people surfing the web using PDAs or even WAP phones.

      There's really no good reason not to produce valid HTML (or, even better, XHTML) and it will make your site far more accessible and flexible.

      --
      <http://www.dave.org.uk>

      "Perl makes the fun jobs fun
      and the boring jobs bearable" - me

      Thanks for that concise and completely convincing defense of the "Best viewed with [INLINE]" school of web design.

      I viewed the results of this code in Lynx (a web browser), and I wonder why you have the code snippets being lined up with the left side of the window in some spots and lined up with the body text (about five characters in) in others.