CNN  — 

It could be said that the casting of Matthew Perry in the role that made him a superstar was divinely inspired.

Perry, who died Saturday at the age of 54, wrote in his 2022 memoir that three weeks before his audition for the role of Chandler Bing on the wildly popular NBC comedy series “Friends,” he was in his tiny Los Angeles apartment reading in the newspaper about actor Charlie Sheen.

“It said that Sheen was yet again in trouble for something, but I remember thinking, Why does he care — he’s famous,” Perry wrote in “Friends, Lovers, and the Big Terrible Thing.” “Out of nowhere, I found myself getting to my knees, closing my eyes tightly, and praying. I had never done this before.”

Perry said his prayer was simple. He simply asked “God, you can do whatever you want to me. Just please make me famous.”

“Three weeks later, I got cast in ‘Friends.’ And God has certainly kept his side of the bargain — but the Almighty, being the Almighty, had not forgotten the first part of that prayer as well,” he wrote.

NBC/Getty Images
Matthew Perry is best known for his role as Chandler Bing on "Friends."
Michael Ochs Archives/Moviepix/Getty Images
Perry, pictured circa 1985, developed an interest in acting after moving to Los Angeles when he was a teen. He was born in Williamstown, Massachusetts, to an actor father and a journalist mother.
NBC/Getty Images
Perry and Christina Applegate were cast in the 1988 made for TV teen movie "Dance 'til Dawn."
Michael Ochs Archives/Moviepix/Getty Images
Actress Martha Plimpton and Perry are seen at the Limelight nightclub in New York City circa 1988.
ABC/Disney Entertainment/Getty Images
Perry guest stars in an episode of "Growing Pains" in 1989. His character was injured in the episode, which was about the dangers of drunk driving.
NBC/Getty Images
Perry co-starred in "Friends" with Matt LeBlanc, Lisa Kudrow, David Schwimmer, Courteney Cox and Jennifer Aniston. The first season aired in 1994.
NBC/Getty Images
Perry is seen in the 1995 "Friends" episode "The One with the Evil Orthodontist."
NBC/Getty Images
The cast of "Friends" drink milkshakes in an iconic promo photo.
NBC/Getty Images
Perry and Cox appear on "The Tonight Show with Jay Leno" in 1996.
Columbia Pictures/Getty Images
Perry co-stars with Salma Hayek in the 1997 romantic comedy film "Fools Rush In."
Getty Images
The cast of "Friends" pose for a promo shot in 1999.
NBC/Getty Images
The sixth season of "Friends" aired in 1999.
NBC/Getty Images
Perry and Cox are seen in the 2000 "Friends" episode "The One With Rachel's Assistant."
Warner Brothers/Getty Images
Michael Clarke Duncan tackles Perry in a scene from the 2000 film "The Whole Nine Yards."
Danny Feld/NBCU Photo Bank/Getty Images
Perry and Cox pose for a photo during the 2001 "Friends" episode "The One With Monica And Chandler's Wedding."
Cinematic/Alamy Stock Photo
Perry portrayed Joe Quincy on "The West Wing" in 2003, seen here alongside Amy Stewart, Richard Schiff and Milo O'Shea.
Toby Melville/Reuters
Perry and British actress Kelly Reilly perform a scene from the West End play "Sexual Perversity in Chicago" at The Comedy Theatre in London in 2003.
Jean-Paul Aussenard/WireImage/Getty Images
Perry competes in the Merv Griffin Beverly Hills Country Club Celebrity Tennis Classic in 2003. Growing up, Perry pursued his passion for tennis and became a top-ranked tennis player in Canada, where he lived with his mother after his parents split.
Mark J. Terrill/AP
Perry prepares to make a statement as fellow "Friends" cast member LeBlanc hands over the award they won for favorite television comedy series at the 2004 People's Choice Awards.
Mitch Haddad/NBCU Photo Bank/Getty Images
Perry made his directorial debut in a 2004 episode of "Scrubs." He is seen here talking to director of photography John Inwood as actors Zach Braff, left, and John C. McGinley look on.
Warner Bros/Courtesy Everett Collection
Perry co-stars with Amanda Peet and Bruce Willis in the 2004 sequel "The Whole Ten Yards."
Chris Pizzello/Reuters
Perry participates in a Screen Actors Guild rally in solidarity with the striking Writers Guild of America in Los Angeles in 2007.
Phil McCarten/Invision/AP
Perry speaks onstage at the Primetime Emmy Awards in 2012. He was nominated four times for the prestigious TV acting award.
Mark J. Terrill/AP
Perry throws out the ceremonial first pitch at a Los Angeles Dodgers game in 2012.
Tom Williams/CQ-Roll Call, Inc./Getty Images
Perry testifies before a House Subcommittee on the need to fund drug courts at the Capitol in 2013. Perry, who was open about his struggles with addiction, was an ambassador for the National Association of Drug Court Professionals.
Michael Yarish/CBS/Getty Images
Perry and Lindsay Sloane are seen behind the scenes on a 2014 episode of the CBS series "The Odd Couple."
Intuition Film Prods/Kobal/Shutterstock
Perry plays Ted Kennedy in the 2017 TV series "The Kennedys After Camelot."
Terence Patrick/CBS/Getty Images
The cast of "Friends" appeared on "The Late Late Show with James Corden" in 2021.
Julia Weeks/AP
Copies of Perry's memoir, "Friends, Lovers, and the Big Terrible Thing," are displayed at a bookstore in 2022.
Dania Maxwell/Los Angeles Times/Getty Images
Perry enters the stage for a conversation with editor Matt Brennan during the Los Angeles Times Festival of Books in Los Angeles in 2023.

Perry almost didn’t get the chance to play Chandler on “Friends.”

It was 1994 and Perry said he was scrambling for work after his“terrible” manager told him he had “no money.”

“So I called my agent and said ‘You’ve got to get me any job, any job you can,’” Perry recalled during a 2015 appearance on “Late Night With Seth Meyers.” “This happened to be the year that ‘Friends’ was shot, but I was off the market because I had taken a job on a pilot called ‘LAX 2194’ that was about baggage handlers at L.A. Airport in the year 2194.”

01:07 - Source: CNN
Matthew Perry reveals what he would do if he didn't become an actor (2002)

Then a script for a show then called “Friends Like Us” came along, he said.

“It was hilarious and great,” Perry said. “There was this part that was perfect for me and it was making me crazy that I couldn’t go up for it because [of] the baggage handlers show. I was losing my mind.”

Fortunately, the TV executives who saw “LAX 2194” thought it was horrible, Perry said, and he was freed up to pursue the role of Chandler, which made him famous.

Perry often said the show changed his life and gave him a lifelong bond with costars Jennifer Aniston, Courteney Cox, Lisa Kudrow, Matt LeBlanc and David Schwimmer.

The actor got emotional talking about it in May 2021, when he and his costars reunited for HBO Max’s “Friends: The Reunion” special. (HBO Max is owned by CNN’s parent company.)

“The best way that I can describe it is after the show was over, at a party or any kind of social gathering, if one of us bumped into each other, that was it,” he explained. “That was the end of the night. You just sat with the person all night long and that was it.”

Cox teared up as Perry spoke.

“You apologized to the people you were with, but they had to understand you had met somebody special to you and you were going to talk to that person for the rest of the night,” he added. “And that’s the way it worked.”