What happens when you try it? It's pretty trivial to test...
Calling script that runs another script with system() (call.pl):
use warnings;
use strict;
system 'perl', 'call.pl';
Script that gets called by the one above that we'll ^C (called.pl):
use warnings;
use strict;
my $c = 1;
while (1){
print $c++ ."\n";
sleep 1;
}
Run call.pl to exec called.pl:
$ perl call.pl
1
2
3
4
5
In another terminal window, see if called.pl is running:
$ ps ax | grep called
29221 pts/9 S+ 0:00 perl called.pl
Yep, it is. Back to the other terminal:
6
7
^C
Check if called.pl is still running after ^C:
$ ps ax | grep called
Nope!
The whole process chain is killed when you kill the top process, unless you explicitly set the process called by system to go into the background, whether it be a daemon, service etc.
|