in reply to Re^3: How to forcefully destroy a thread
in thread How to forcefully destroy a thread

Note that this code does not kill() the thread, it kills another process: open P,"program|" or qx will fork() and then exec() a new program, so that will have a different PID.