defined(my $pid = open(KID_TO_READ, "-|")) or die "Can't fork: $!"; if ($pid == 0) { # child sleep(5); # Do initialization here print "Done with Init\n"; close(STDOUT); open STDOUT, ">&STDERR"; # Now serve connections # blah blah blah } else { # parent waits for child to init $_ = <KID_TO_READ>; # wait for line or close }
In reply to Re: Backgrounding (daemonizing?) a Net::server
by Thelonius
in thread Backgrounding (daemonizing?) a Net::server
by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |