Let's take a look at the entire script in one big statement, and the output it produces:
print $cgi->start_html(And the full output of our script (just think of all the HTML you won't have to write!):
-title => 'My CGI.pm Web Page',
-meta => {
'keywords' => 'perl, perl cgi, cgi.pm',
'description' => 'cgi.pm tutorals'
},
-style => {
-src => '/css/main.css'
},
-script => {
-language => 'javascript',
-src => '/javascript/main.js'
}
); print $cgi->end_html;
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"><head><title>My CGI.pm Web Page</title>
<meta name="keywords" content="perl, perl cgi, cgi.pm" />
<meta name="description" content="cgi.pm tutorals" />
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<script src="/javascript/main.js" type="text/javascript"></script>
</head><body></body></html>
