in reply to Re: calling one cgi script from another
in thread calling one cgi script from another

I've been reading up on this and have implemented the fork:
if ($pid = fork) { print "I am parent\n"; } elsif (defined $pid) { print "I am child\n"; sleep 5; print "Child is done\n"; } else { die "Major error: $!"; } print "PID: $$\n";
However I need the child to run in the background, for the browser to be freed up on printing the parent. Can anyone point me in the right direction, please?

Replies are listed 'Best First'.
Re^3: calling one cgi script from another
by derby (Abbot) on Feb 21, 2007 at 17:57 UTC

      Actually, I don't want to keep an eye on it - I just need ti to carry on until it's finished.

      Effectively I need system "long_running_code with parameters &"; but not in the shell as I need to pass arguments

        I'm sure if you *read* the article, the only diff you'll notice is what you do in the parent after the fork (create a meta-refresh page like merlyn does or another landing page like you do).

        -derby