use POSIX ":sys_wait_h"; # do whatever that sets $SIG{CHLD} to 'IGNORE' { local $SIG{CHLD} = 'DEFAULT'; # do something interesting here, for example... my $return = system("gzip somefile"); if($return != 0) { # handle exception here } } # reap any zombies that accumulated while # $SIG{CHLD} was set to 'DEFAULT' while ( (my $pid = waitpid(-1, WNOHANG)) > 0 ) { print "reaped $pid with status $?\n"; } #### use Data::Dumper; print Dumper(\%SIG); $SIG{CHLD} = 'IGNORE'; print Dumper(\%SIG);