Matthew Perry's 'serious' condition

Matthew Perry's condition was "very serious" when he was hospitalised three months ago.

The former 'Friends' star revealed on last week that he had been staying in hospital for a lengthy three months after undergoing an emergency operation to fix a gastrointestinal perforation, which causes severe abdominal pain and tenderness and can be fatal.

And now, sources say he was "very sick" when he was taken into hospital, and his three month recovery time was needed as "healing can be complicated" following the surgery.

The source told People magazine: "Matthew was very sick when he was hospitalised; his condition was very serious. A gastrointestinal surgery is very complex, and the healing can be complicated."

Matthew, 49, left hospital last week according to sources, just one day after taking to social media to reveal the news of his lengthy recovery time.

He wrote: "Three months in a hospital bed. Check."

His representative first confirmed the need for surgery last month.

They said at the time: "Matthew recently underwent surgery in a Los Angeles hospital to repair a gastrointestinal perforation. He is grateful for the concern and asks for continued privacy as he heals."

A gastrointestinal perforation or ruptured bowel occurs when a hole develops in the lining of the gastrointestinal tract and can be caused by illnesses such as Crohn's disease, colitis and appendicitis.

Although it is usually repairable, doctors have to work fast to prevent the contents of the gastrointestinal tract from spilling out into the stomach and causing an infection.

Once an infection develops, it can lead to sepsis and ultimately cause death.

Exact details on Matthew's surgery are still not known but he has been very open in the past about his struggles with alcohol abuse, which can contribute to digestive health issue.

The actor completed a 48-day programme in rehab for Vicodin addiction in 1997 after he turned to the drug to stop him from "drinking as much" as he was.

In 2001, he checked back into a rehab facility to recover from his use of Vicodin, methadone, amphetamines, and alcohol.

He said previously: "I've had a lot of ups and downs in my life and a lot of wonderful accolades but the best thing about me is that if an alcoholic comes up to me and says, 'Will you help me stop drinking?' I will say, 'Yes. I know how to do that.' "