if (!($PID = fork())) { SOME_SUB(); } else { SOME_OTHER_SUB(); } The child will run until it hits an exit or die....