If you are redirecting you need to do
$q->redirect("form.cgi?key1=val1&key2=val2");
You also combine them into 1 script and do something like this
if(defined $q->param('form_submitted')){
if(&errors){ #Error occured
&display_form($q);
}else{
&thank_you;
}
}else{
&display_form;
}
sub display_form(){
##Do form stuff
}
Also in display_form(), you might want to consider using
HTML::Template and doing
$temp = HTML::Template->new(
file => 'file.tmpl',
associate => $q
);
which will put all the submitted values into the template as long as the associated <TMPL_VAR NAME=".."> tags are there.