Ah, I see. I like offloading things like this to modules, in this case I think IPC::Run would be appropriate, the following works for me. If you think the child might misbehave and not terminate on SIGINT, see the IPC::Run doc section "Timeouts and Timers" on how to time out the kill operation.
use IPC::Run qw/start/; my $h = start ['play','-q','/home/myname/soundfile.wav']; sleep 5; $h->signal('INT'); $h->finish;
In reply to Re^3: Killing a child process
by haukex
in thread Killing a child process
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |