print "Content-type: text/html\n\n";
print "<h1>This is the time!</h1>";
print qq{<html><body bgcolor="blue"><title>The Time</title></body>\n};
printf qq{The time is now %s<br>Thanks for visiting},scalar localtime;
print "</html>";
The line which prints the Content-type must end with two
newlines -- this is the signal to your web browser that the headers are complete,
and the actual page follows. The value of text/html tells the browser
that what follows is HTML, and should be interpreted accordingly. Without this
or a similar header, most browsers will not be able to read your output. The
rest of the program simply prints out some text, which you may recognize as
simple HTML. If you know how to write HTML, you may not need much from the CGI
module; if you don't, you'll find that the CGI module
eliminates the need to learn too much about HTML.