C
C&J
Hi,
I have a cod as following :
....
my $stop = 0;
sub my_sigint_catcher {
$stop = 1;
};
$SIG{'INT'} = 'my_sigint_catcher';
while (1) {
....
system("ANOTHER PERL SCRIPT");
...
last if ($stop);
}
exit 0;
Here is my question:
1. The system(" ... ") has its own $SIC{'INT'} handler. Therefore, when I do ctrl-c during this period, the $stop never get set.
Is that possible to catch this ctl-c during system("...")'s execution?
2. I thought another easy to fix the problem is to use special combination dedicated for this, such as (F1 key, or CTRL-O).
How can I do this? or where can I find related tutorial?
Thanks
Chris
I have a cod as following :
....
my $stop = 0;
sub my_sigint_catcher {
$stop = 1;
};
$SIG{'INT'} = 'my_sigint_catcher';
while (1) {
....
system("ANOTHER PERL SCRIPT");
...
last if ($stop);
}
exit 0;
Here is my question:
1. The system(" ... ") has its own $SIC{'INT'} handler. Therefore, when I do ctrl-c during this period, the $stop never get set.
Is that possible to catch this ctl-c during system("...")'s execution?
2. I thought another easy to fix the problem is to use special combination dedicated for this, such as (F1 key, or CTRL-O).
How can I do this? or where can I find related tutorial?
Thanks
Chris