Hi.

Having some fun with CGI.pm html4 methods.

using CGI I do

use CGI qw/:html4 -no_xhtml/; print $q->(-dtd=>'//W3C//DTD HTML 4.01//EN');

1. Even though I import 4.01 in the dtd of the cgi object I still need to state -no_xhtml after importing CGI otherwise the xmlns namespace appears underneath the html4 strict dtd.

2. After excluding the xmlns namespace I cannot see how to append the html4 strict dtd url on to the dtd so that it reads as required that is

<"//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

If I try to print it by appending to the dtd like so

print $q->(-dtd=>"'//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/htm +l4/strict.dtd'");

then cgi.pm turns the dtd into the html4 transitional dtd. If I attempt to manually print the dtd prior to using cgi to construct the header the served html fails.

As I need to put this up onto a live server what I need to know is whether the address part of the dtd is important or not. And if it is is there a workaround (or method i'm missing), I kind of always assumed it was as important as the dtd declartion that precedes it.


In reply to cgi.pm -import strict html4 address into html4 strict dtd header by Don Coyote

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.