How To Declare DOCTYPE And Encoding Using CGI.pm And PERL

I found myself needing a specific doctype the other day and this is what I found… First, get the correct doctype string from the W3C website list. Then, simply use -dtd to specify it to CGI.pm during the call to start_html:
1 2 3 |
-dtd => '-//W3C//DTD HTML 4.01 Transitional//EN' -OR- -dtd=>['-//W3C//DTD HTML 4.01//EN','http://www.w3.org/TR/html4/strict.dtd'] |
In addition, use -encoding to specify the character set for XHTML. It defaults […]