“Perks” had something of the same effect on Stephen Chbosky, the writer (of the book and the movie) and first-time director. Mr. Chbosky, a native of Pittsburgh, began writing the slim novel in college and returned to it in earnest at 26, when he finally moved out of his parents’ house. Told in letters by a shy loner, Charlie (played by Logan Lerman, star of “Percy Jackson & the Olympians”), it follows him, Sam and her stepbrother, Patrick (Ezra Miller, soon to be an indie heartthrob), as they navigate the perils of adolescence in 1991. It has the requisite era-specific pop-culture references (the Smiths’ “Asleep”; midnight screenings of “The Rocky Horror Picture Show”) and deals with thorny subjects like sexual abuse, suicide, drug use and homosexuality: “The Catcher in the Rye” crossed with “Go Ask Alice” for an emo generation.

It was a quick sensation after it was published, earning cult status and a place on many school reading lists. Mr. Chbosky, 41, moved from Pittsburgh to New York and then Los Angeles to work in TV and movies. He wrote the screenplay for the film version of “Rent,” but is best known as the show runner on “Jericho,” a short-lived CBS series set in the aftermath of a nuclear attack. (“I love my Stephen King” was his explanation for his ranging tastes.)

Though he recalled being a well-liked athlete in high school, “on the inside I was a misfit kid,” he said. Afraid to participate in “Rocky Horror” himself, he had Charlie do it in “Perks.” Mr. Chbosky said he had many offers to turn the book into a movie over the years, but resisted unless he could direct it himself. “It was so personal,” he said. “I’ve seen the effect the book has had on certain kids who’ve seen bad things. Some of their stories, which they’ve told me in letters, would break your heart.” He didn’t mind waiting and treating the material preciously.

“I don’t need the money,” he said, eating chocolate cake in the school cafeteria during an interview. “What I need is for that 14-year-old kid to know they have a chance.”

“Perks” found the right collaborator in John Malkovich’s production company, Mr. Mudd, which has made other indie films about adolescents and oddballs, like “Ghost World” and “Juno.” “I asked our assistant if there was any book he could turn into a movie, and he named this book,” said Lianne Halfon, a partner in Mr. Mudd. “We’d never heard of it.” Once news of a potential adaptation got out, Ms. Halfon said, she too was inundated with e-mails from fans of the book, people who were “lonely in their families,” as she put it. “For them this book is very important.”