in reply to How to make `system` not ignore SIG INT in Perl?
Seems to me that ^C works quite fine when system is in progress:
$ perl -MTime::HiRes=time -E' for (;;) { my $s=time; system("sleep", "1"); say time-$s; } ' 1.0089168548584 1.00794720649719 1.00801014900208 ^C0.0198760032653809 ^C0.180072069168091 ^C0.147971153259277 ...
SIGINT is indeed being sent and received, and a process does indeed die as a result.
Perhaps you want to check the result returned by system and avoid looping if the child returned an error or died from a signal?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to make `system` not ignore SIG INT in Perl?
by PerlOnTheWay (Monk) on Sep 13, 2011 at 05:54 UTC | |
by ikegami (Patriarch) on Sep 13, 2011 at 05:54 UTC | |
by PerlOnTheWay (Monk) on Sep 13, 2011 at 06:02 UTC | |
by ikegami (Patriarch) on Sep 13, 2011 at 06:04 UTC | |
by PerlOnTheWay (Monk) on Sep 13, 2011 at 06:05 UTC | |
|