in reply to problem with forking
See fork for more information. If the fork() succeeds, the parent process will receive the pid of the child process. The child process, which I assume you want to launch the other program, will receive zero.
Also, I expect you want to use exec to launch the program, not backticks. Otherwise, you probably need to call exit in the child process so it won't continue to fork off programs.
sub launch_chimera { my $pid = fork(); die "Unable to fork\n" unless defined $pid; return if $pid; exec(qw( chimera --send test.pdf )); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem with forking
by sandeep.ses (Acolyte) on Jul 05, 2004 at 22:40 UTC | |
by chime (Friar) on Jul 06, 2004 at 10:39 UTC |