. . } else { # parent print "forked child \$pid= $pid\n"; wait(); # Added exit 0; } . .