Re: CGI and CSS question



perlUSER wrote:

The following lines are appearing in the output. I removed these lines
from the html page I have generated and I like what I see.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
Question is how can I tell my CGI/Perl not to write the above three
liens?

Well uhm, like you said, by removing it from the HTML output :-) The
script will not print anything you don't ask for.

Here is an example that should help you further.

yourfile.pl

#!/usr/bin/perl
print "Content-Type: text/html; charset=iso-8859-1\n\n";
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
print <<HTML;
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<link rel="style***" href="http://www.mysite.com/mystyle.css";
type="text/css" media="all">
</head>
<body>
<a href="http://www.google.com/";>Google</a>
</body>
</html>
HTML

This be http://www.mysite.com/mystyle.css

a:link { color:blue; }
a:visited { color:purple; }
a:hover { color:red; }
a:active { color:orange; }

--
Bart

.