use strict; use warnings; use CGI; ... # first one, processes POST data if present my $q = new CGI(); ... # passing the anon hash causes this CGI.pm object # to read its params from the hash instead of # the environment my $q2 = new CGI({}); #### use strict; use warnings; use CGI; ... my $q = new CGI(); ... if( $someRedirectCondition ) { my $q2 = new CGI({}); $q2->param('copy' => $q->param('copy') ); $q2->param('foo' => 'bar'); $q2->param('qux' => 'baz'); ... my $uri = "http://some.domain/and/a/path?" . $q2->query_string(); print $q2->redirect( -uri => $uri ); exit 0; }