I am running a perl script on a Linux host. I\'m trying to write a script that forks, where the child starts a program that takes forever and the parent times out after 5 s
I think the problem is with the '0' you are passing as first argument of 'kill'. When I read the docs, they say that '0' will just check to see whether you can send a signal to the process, without sending it. In your case, you want to send the 'KILL' signal to the child process, so do this:
kill( 'KILL', $childPid );