Depending on the cause, perforation can be prevented by preventing any underlying disease that may lead to intestinal perforation. Ulcer disease should be treated with appropriate medicines. Patients with diverticulitis must follow a high fiber diet.