say, it takes the entire http session 60 seconds from start to finish to submit the url, the script to run and return the results

I want:
 print "Starting...\n";
 nowaiturl("$url?foo=bar");
 print "$url has been submitted, in appx 60 seconds it will finish";

to run in like it had been (obviously it'll take a bit more than print() but it illustrates the idea):
print "Starting...\n";
print "$url?foo=bar";
print "$url has been submitted, in appx 60 seconds it will finish";


make sense?

I attempted this with fork() (code modified from http://www.perl.com/pub/a/2003/01/07/mod_perl.html?page=2)but it still seems the parent (or at least the time it takes the script to finish) waits for the child to finish:


#!/usr/bin/perl

use strict;
use warnings;


$SIG{CHLD} = 'IGNORE'; defined (my $kid = fork) or die "Cannot fork: $!\n"; if ($kid) { sleep(2); # fake command taking time # print "Doing url now - Parent $$ has finished, kid's PID: $kid\n"; } else { print "Hello\n"; }

Any ideas how I can get the child process code to go on once the child is started and once the parent finishes the entire script is done?

As in if you execute that script I want it to do:

# ./scriptabove.pl
Hello
#

super fast while the kid's sleep(2) (in real life code that might take a few seconds) doesn't make it wait for 2 seconds for the next prompt to show up.

Looking over
perlddoc perlipc
now...

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to