The former Friends funnyman has grappled with numerous personal issues over the years, including alcohol addiction and prescription drug problems, and he's convinced he wasn't a ""nice"" person.
Perry is adamant he's now changed, and he's poured his past experiences into writing new TV show Mr Sunshine, which will see him play a womanising sports manager suffering a mid-life crisis.
And the actor admits he based the character on himself.
He tells Reuters, ""This character is me, like five years ago, before any possible enlightenment could have come into my life. I am very in touch with that kind of selfish guy who is trying to have a better life and how confused a selfish person would get if he were told that the way to have a better life is to be nicer to people.
""The guy is just learning now not to be a selfish jerk... They say, write what you know. So that's an interesting road to go on - changing terrible behaviour to being a better guy... I knew if I wrote something, that would be a component of it. I am much nicer now!""
Mr Sunshine will debut in early 2011.