Tried to do this a while ago and had the same fork/exec problem. It's possible to fork/exec and have the page load. Apache waits for the child process to close off its handles before loading. So you just have to close them manually:
if (!defined( my $child_pid = fork()))
{ die "Cannot Fork: $!" }
elsif ($child_pid)
{
print "</body></html>";
exit(0);
}
else
{
close(STDOUT);
close(STDERR);
close(STDIN);
exec("$my_command");
exit(0);
}
If you're planning on launching processes and don't really need a web interface, it's worth considering perl Tk. OK user interface, fewer security issues, and no quirks introduced by apache.