neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
Brothers and Sisters, please consider this CGI script:
#doing stuff up here. my $pid; if (!defined ($pid = fork)){ DieNice("Unable to fork: $!\n"); }elsif (! $pid){ close(STDIN); close(STDOUT); close(STDERR); }else{ print header, start_html, h2('Sending Mail...'), "\t<meta http-equiv=\"refresh\" content=\"5; url=http://mydomain +.com:8090\">\n", end_html; #Here the user is redirected. } while (<@to>){ chomp($_); push @chunk, $_; $count ++; if ($count == 80){ #splits bcc into small chuncks $to = join ",", @chunk; mailout(); $count = 0; @chunk = (); } } #still doing more time consuming stuff...
I want the user to be redirected and freed from the CGI while it continues to run its code. Is this the correct way to do it? I borrowed this code from a usenet article but I don't fully understand it. Can someone please explain how this works and if it's correct?
Thank you,
Neil Watson
watson-wilson.ca
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Understanding fork
by RMGir (Prior) on Nov 08, 2002 at 16:44 UTC | |
by neilwatson (Priest) on Nov 08, 2002 at 17:38 UTC | |
by RMGir (Prior) on Nov 08, 2002 at 18:21 UTC | |
Re: Understanding fork
by robartes (Priest) on Nov 08, 2002 at 19:20 UTC | |
Re: Understanding fork
by ehdonhon (Curate) on Nov 08, 2002 at 20:38 UTC | |
Re: Understanding fork
by petral (Curate) on Nov 08, 2002 at 23:01 UTC |
Back to
Seekers of Perl Wisdom