Matthew Perry secretly spent the past three months in hospital.

The former 'Friends' star was rushed into a hospital in Los Angeles, California, in order to have an emergency operation to fix a gastrointestinal perforation, which causes severe abdominal pain and tenderness and can be fatal and has spent an extended period of time recuperating.

He tweeted: ''Three months in a hospital bed. Check.''

Matthew's representative confirmed the surgery last month, saying: ''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.

Details on Matthew's surgery are 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 48-year-old 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.' ''