$TITLE="Frameset Example";
# We use the path information to distinguish between calls
# (1) create the frameset
# (2) create the query form
# (3) create the query response
$path_info = $query->path_info;
# If no path information is provided, then we create
# a side-by-side frame set
# If we get here, then we either create the query form
# or we create the response.
&print_query
if $path_info=~/query/;
&print_response
if $path_info=~/response/;
$script_name = $query->script_name;
<html><head><title>$TITLE</title></head>
<frame src="$script_name/query" name="query">
<frame src="$script_name/response" name="response">
print $query->start_html($TITLE);
print qq{<P
><hr
><A HREF
="../index.html" TARGET
="_top">More Examples
</A
>};
$script_name = $query->script_name;
print "<H1>Frameset Query</H1>\n";
print $query->startform(-action
=>"$script_name/response",-TARGET
=>"response");
print "What's your name? ",$query->textfield('name');
print "<P>What's the combination?<P>",
$query->checkbox_group(-name
=>'words',
-values=>['eenie','meenie','minie','moe']);
print "<P>What's your favorite color? ",
$query->popup_menu(-name
=>'color',
-values=>['red','green','blue','chartreuse']),
print "<H1>Frameset Result</H1>\n";
print "<b>No query submitted yet.</b>";
print "Your name is <EM>",$query->param(name
),"</EM>\n";
print "<P>The keywords are: <EM>",join(", ",$query->param(words
)),"</EM>\n";
print "<P>Your favorite color is <EM>",$query->param(color
),"</EM>\n";