you could do a redirect to the second script and have that script look for the info. If you do that then you can have a redirect that works in the headers:
if ($foo eq "successfull") {
print $query->redirect(-location=>'http://example.com/cgi-bin/seco
+ndscript.pl?foo1=$foo1&foo2=$foo2',-nph=>1);
exit;
}
or in the body (the Content-type is only needed if you havent printed your headers)
print "Content-type: text/html\n\n";
print <META HTTP-EQUIV=refresh CONTENT="0;URL=http://example.com/cgi-b
+in/secondscript.pl?foo1=$foo1&foo2=$foo2">
-p