You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
programming-examples/perl/CGI/Values Carried Between Page...

37 lines
646 B
Perl

5 years ago
#!/usr/bin/perl -T
use strict;
use CGI qw/:standard/;
print header;
if (param('color')) {
print start_html('Hello'),
"Hello ", param('name'),p,
"Your favorite color is: ",param('color'),p,
hr;
}
elsif (param('name')) {
print start_html('Hello'),
"Hello ",
param('name'),
p,
start_form,
"Please enter your favorite color: ",textfield('color'),
hidden(-name=>'name',-value=>param('name')),
submit,
end_form,
hr;
} else {
print start_html('Hello'),
start_form,
"Enter your name: ",textfield('name'),
submit,
end_form,
hr;
}
print end_html;
exit;