Matthew Perry has signed to play a mentally unstable screenwriter in “Numb,” an indie dark comedy that marks a rare foray to the big screen for the former “Friends” star.

Perry’s character suffers from acute depersonalization disorder, a condition so alienating and sanguine that it makes the chronically depressed look perky. When he falls for a girl, he puts himself through every single therapy in the book in order to win her love.

The project marks the feature directing debut of its Canadian-born writer, Harris Goldberg, who co-wrote and co-produced “Deuce Bigalow: Male Gigolo.”

Perry recently wrapped Aaron Sorkin’s pilot “Studio 60 on the Sunset Strip” for NBC. The pilot is expected to be picked up for a series. His recent feature credits include “The Whole Ten Yards” and “Serving Sara.”