use Storable; # unpack history from form, and add latest form's settings my %formhash = %{ thaw( decode_base64( $q->param("history")) ) }; foreach $p ($q->params) { $formhash{$p}=$q->param($p}; } # meat of program # pack back up. $template contains template file contents. my $frozen = encode_base64( freeze \%formhash ); # someone check this pls $template =~ s/HISTORYBUF/$frozen/; print $template; # do a "print $q->header" at top