if (fork) { #in parent if (fork) { #in parent still waitpid -1, undef; print "-- ", $?>>8, "\n"; } else { # in second child exit 4; } } # else ??? # parent and first child drop off the end