BEGIN { package Net::SSH::Expect; use POSIX qw(:signal_h WNOHANG); $SIG{CHLD} = \&reapChild; sub reapChild { do {} while waitpid(-1,WNOHANG) > 0; } } #### local $SIG{CHLD} = \&reapChild;