Take a look at Chapter 16 of Programming Perl. If forking off a child process is the best way to go, you can achieve this via an anonymous pipe. Sort of like this:
if(! $pid){
open PIPE, "| .gw1.cgi userid=param('userid') gw1=param(+'gw1')"
or die "Couldn't fork $!";
}