in reply to Starting a process in the background that lives after perl dies.
#!/usr/bin/perl -w use strict; my $pid = fork(); if ($pid == 0) { # This is the child process. # exec() the external program. exec("my_program") or die "could not exec my_program: $!"; } elsif (!defined($pid)) { die "could not fork"; } # Everything below here is the parent process print "This is the parent process\n";
-Matt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Starting a process in the background that lives after perl dies.
by ehdonhon (Curate) on Nov 08, 2001 at 23:43 UTC | |
by DrManhattan (Chaplain) on Nov 08, 2001 at 23:51 UTC | |
by ehdonhon (Curate) on Nov 09, 2001 at 01:09 UTC |