in reply to Making a 'blank' xhtml page - request for comments
I would appreciate your comments/criticism on the script.
this doesn't even compile, but that's probably a bad copy & paste problem -- you forgot the end XHTMLBODY.sub page_body { # The body area and closing tag print <<XHTMLBODY; <body> </body> </html> }
Not bad. It's valid XHTML, and it doesn't look too bad. You've accomplished what you set out to do.<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; chartset=iso-8859-1" /> <meta name="author" content="mynamehere" /> <meta name="copyright" content="mynamehere" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <title>PUT-YOUR-TITLE-HERE</title> </head> <body> </body> </html>
which outputsuse CGI::Fast qw(start_html endhtml); print start_html(-title=>'PUT-YOUR-TITLE-HERE', -enctype=>'iso-8859-1', -meta=>{ 'author'=>'my name here', 'copyright'=>'my name here', 'keywords' => '', 'description' =>'' }, ), end_html ;
Pretty similar (the encoding in the xml header differs and the DTD is XHTML Basic, not Strict, and CGI adds the http-equiv and enctype to the body tag.). If this isn't too big a difference, you could cut down your code to far fewer lines. If you're concerned about readability, substitue CGI::Pretty for CGI::Fast. (Wouldn't a CGI::Fast::Pretty be nice?)<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>P +UT-YOUR-TI TLE-HERE</title> <meta name="description" content="" /> <meta name="author" content="my name here" /> <meta name="keywords" content="" /> <meta name="copyright" content="my name here" /> </head><body http-equiv="text/html" enctype="iso-8859-1"></body></html +>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: the finest hand rolled XHTML known to man vs. evil factory produced XHTML (boo)
by func (Acolyte) on Apr 15, 2002 at 00:31 UTC |