#!/usr/bin/perl -Tw use CGI; my $cgi = new CGI; # show current list print "\n\n"; print join(" ",$cgi->Vars()); print "\n"; if (open(FILE, "<./saved_params.txt")) { # add saved parameters while() { chomp; # CGI's save() ends the file # with = alone on the last line last if $_ =~ /^=$/; # split out the key=value pair my($key, $val) = split(/=/,$_,2); # and add them to the current list $cgi->param($key=>$val); } } # show final list print "--\n"; print join(" ",$cgi->Vars()); print "\n\n"; # save final list if (open(FILE, ">./params")) { $cgi->save(FILE); close(FILE); }