#!/usr/bin/perl -w use strict; use warnings; use CGI::Carp qw/fatalsToBrowser/; use CGI qw(:standard); my $action; print header; print start_html('A Simple Example'), h1('A Simple Example'), start_form(-method=>$method,-action=>$action), "What's your name? ",textfield('name'), p, "What's the combination?", p, checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','minie']), p, "What's your favorite color? ", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']), p, #submit, submit(-name=>'hello', -values=>"Hello"), submit(-name=>'hello1', -values=>"Hello1"), end_form, hr; if (submit eq 'hello') { $action = "preview.cgi", } elsif (submit eq 'hello1)' { $action = "post.cgi", } print end_html;