With the release of his new memoir Friends, Lovers and the Big Terrible Thing, Matthew Perry opened up about his past struggles with addiction and the long road to recovery. And the actor, 53, says the path to sobriety was a pricey one.

"I've probably spent $9 million or something trying to get sober," Perry told The New York Times in an interview ahead of the memoir's November 1 release, per People.

The Friends star, who is best known for his role as Chandler Bing on the iconic NBC sitcom, has only recently come forward about his decades-long struggle with alcohol and opiate addiction.

Perry, who also shared that he recently celebrated a landmark 18 months of sobriety, says that maintaining his sobriety is the necessary starting point for everything in life.

"Because if you don't have sobriety, you're going to lose everything that you put in front of it, so my sobriety is right up there. I'm an extremely grateful guy. I'm grateful to be alive, that's for sure. And that gives me the possibility to do anything," he said.

Related:

Matthew Perry Commends Friends Co-Stars for Being 'Like Penguins' While He Was Sick

Perry Shares Therapist Advice That Helped Him Break Through

Friends: The Reunion Director Addresses Matthew Perry's Slurred Speech and Fans' Concerns

Though Perry tried to keep his addiction under wraps, even when he was taking 55 Vicodin a day and dropped to only 128 pounds, things came to a terrifying head when the actor's colon burst from years of substance abuse.

"The doctors told my family that I had a 2 percent chance to live. I was put on a thing called an ECMO machine, which does all the breathing for your heart and your lungs. And that's called a Hail Mary. No one survives that," Perry said of the horrifying ordeal, which ultimately resulted in a five-month hospitalization.

"There were five people put on an ECMO machine that night and the other four died and I survived. So the big question is why? Why was I the one? There has to be some kind of reason," he added.

The star found reason in sobriety, using the health scare as a catalyst to quit drugs and alcohol for good. Along with supportive friends, family, and former co-stars, Perry began the path to recovery. While it wasn't easy, he says found motivation in a piece of advice from his therapist that was almost worth the $9 million price tag alone.

"My therapist said, 'The next time you think about taking OxyContin, just think about having a colostomy bag for the rest of your life,'" he shared. The actor temporarily had a colostomy bag placed while hospitalized, and the thought of going through that again was enough to curb his cravings.

"And a little window opened, and I crawled through it, and I no longer want OxyContin."

Friends, Lovers and the Big Terrible Thing will be available wherever books are sold beginning Nov. 1.