in reply to How to see the processId of the process called by system command from perl

How are you calling the R script? With the system function? Are you forking before you call it? Is the script going to the background? Best way would probably be to fork and call the R script in that new process via system:
my $pid = fork; defined $pid or die "fork failed: $!"; if ($pid) { # in parent: waitpid $pid; # wait for the child, which's pid is in $pid } else { # in child: system ("R ..."); exit; }
  • Comment on Re: How to see the processId of the process called by system command from perl
  • Download Code