#!/usr/local/bin/perl -w use strict; use CGI qw(:standard); # Include standard HTML and CGI functions use CGI::Carp qw(fatalsToBrowser); # Send error messages to browser my @foodmenu = ['Pizza','Garlic Bread','Apple Pie','Ice Cream']; &printheader; if (param()) { &displayorder; } &printform(@foodmenu); &printtail; sub printheader { print header(), start_html(-title=>"Pizza Order Form", -bgcolor=>"#00CCFF"), h1("Mikey's Pizza Delivery Service"), hr; } sub printtail { print address("pizzaman\@pizza.co.uk"), end_html(); } sub printform { my $foodchoices = $_[0]; print h1("Order your food here"), start_form(), "What's your name? ", textfield("name"), p, "What's your phone? ", textfield("phone"), p, "Food order? ", checkbox_group(-name=>'food', -values=>\@$foodchoices, -columns=>2, -multiple=>'true'), p, submit("Submit form"), reset("Clear form"), end_form(); } sub displayorder { print h1("You have ordered..."); print "
"; }