CGI.pm defines functions that emit HTML. The page is easier to read and write than raw HTML*
* if you speak Perl!
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>Vegetables</title>
</head><body>
<h1>
Eat Your Vegetables
</h1>
<ol>
<li>
peas
</li>
<li>
broccoli
</li>
<li>
cabbage
</li>
<li>
peppers <ul>
<li>
red
</li>
<li>
yellow
</li>
<li>
green
</li>
</ul>
</li>
<li>
kolrabi
</li>
<li>
radishes
</li>
</ol>
<hr></body></html>
#!/usr/bin/perl
# Script: vegetables1.pl
use CGI ':standard';
print header,
start_html('Vegetables'),
h1('Eat Your Vegetables'),
ol(
li('peas'),
li('broccoli'),
li('cabbage'),
li('peppers',
ul(
li('red'),
li('yellow'),
li('green')
)
),
li('kolrabi'),
li('radishes')
),
hr,
end_html; |
|
| Contents | Next |