in reply to Killing a hanging child process
(from perldoc -f waitpid)
use POSIX ":sys_wait_h"; ... do { $kid = waitpid(-1, WNOHANG); } until $kid > 0; [download]
status of the child is in $?
HTH!