Hope this is of more help than the first posters comment. We all had to start once#!/usr/bin/perl -w use strict; use CGI; use Errno qw(EAGAIN); my $pid; my $page = new CGI; print $page->header(), $page->start_html(); FORK: { if ($pid = fork()) { print <<HTML; <CENTER> In the parent process<BR> HTML print $page->end_html(); exit; } elsif (defined $pid) { print <<HTML; <CENTER> In the child process<BR> HTML print $page->end_html(); close STDIN; close STDOUT; close STDERR; exec ('sleep 60'); exit; } elsif ($! == EAGAIN) { print qq(Re-doing fork\n); sleep 5; redo FORK; } else { die qq(Can't fork: $!'n); } }
In reply to Re: Re: Re: creating a fork process
by ColtsFoot
in thread creating a fork process
by richp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |