#!/usr/bin/perl -w use CGI qw(:standard); $q=new CGI; print $q->header('text/html'), $q->start_html, $q->h1('first test'), $q->a({-href=>'http://tandem.bu.edu', -target=>'_trdb'},"TRDB"), $q->br, $q->a({-href=>'http://www.w3.org/TR/REC-html40/cover.html#minitoc', -target=>'_new'}, "HTML Reference Table of Contents" ), $q->br, $q->img({src=>'http://bioed.bu.edu/gbenson/images/snoopy_beagle.gif'} ), $q->br, $q->ul( li({-type=>'circle'},['Sneezy','Doc','Sleepy','Happy']) ), $q->table({-border=>undef}, caption('When Should You Eat Your Vegetables?'), Tr({-align=>CENTER,-valign=>TOP}, [th(['Vegetable', 'Breakfast','Lunch','Dinner']), td(['Tomatoes' , 'no', 'yes', 'yes']), td(['Broccoli' , 'no', 'no', 'yes']), td(['Onions' , 'yes','yes', 'yes']) ]) ); print $q->start_form(-method=>'POST', -action=>'perl.test1.pl', -enctype=>'application/x-www-form-urlencoded'), $q->br, "Enter your name:", $q->br, $q->textfield(-name=>'user_name', -default=>'starting value', -override=>1, -size=>50, -maxlength=>80), $q->br, "Enter your address:", $q->br, $q->textarea(-name=>'mailing_address', -default=>'starting value', -rows=>6, -columns=>50), $q->br, $q->submit(-name=>'submit_button', -value=>'submit'), $q->endform, $q->hr; if ($q->param()){ #tests if anything has been returned my $user=param('user_name'); my $address=param('mailing_address'); print "User: $user", $q->br, "Mailing address: $address", $q->br, $q->hr; } print $q->end_html;