print form_start; # cycle through all the previous hidden fields plus the # newest form for($cgi->param){ #only pass the fields in %good_fields next unless $good_fields{$_}; #write the good_fields fields into hidden inputs print $cgi->input( -type=>'hidden', -name=>$_, -value=>$cgi->param($_)); } # print out the next form in the sequence based on the # last 'next' hidden field print get_next_form($cgi->param('next')); print end_form;