Make HTML Beautiful

CGI.pm defines functions that emit HTML. The page is easier to read and write than raw HTML.

Script II.1.1: vegetables1.pl

 #!/usr/bin/perl
 # Script: vegetables1.pl
 use CGI::Pretty ':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;

What it Looks Like

http://localhost/cgi-bin/conference/vegetables1.pl
<< Previous Contents >> Next >>

Lincoln D. Stein, lstein@cshl.org
Cold Spring Harbor Laboratory
Last modified: Sat Aug 21 13:32:59 PDT 1999