in reply to Re^2: waitpid(-1, WNOHANG) is hanging
in thread waitpid(-1, WNOHANG) is hanging

Or simply
use POSIX qw( WNOHANG );