in reply to Re^2: Run and Stop another program in perl
in thread Run and Stop another program in perl
In my case, there is good reason for that. Did you notice the OPs program name: program.exe?
On win32, it makes no difference. The following code does kill 15, but notice that it is reported by the terminatng process as sigbreak:
Perl> $pid = open CMD, '-|', q[perl.exe -le"$SIG{TERM}=sub{print 'here +' }; $|++; print ++$i while sleep 1"] or die $!;; Perl> print scalar <CMD> for 1 .. 10;; 1 2 3 4 5 6 7 8 9 10 Perl> kill 15, $pid;; Terminating on signal SIGBREAK(21)
The pseudo signals perl provides on win32 are useful, but limited. And bear very little resemblance to POSIX signal handling.
|
|---|