http://www.perlmonks.org?node_id=211463

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