Perry is interviewed by talk show host and comedian Chelsea Handler for the magazine, and Perry opens up about her exes, dating and her sex life.

Perry tells Cosmo (courtesy of E! Online), that in regards to her marriage with Russell Brand, she's since matured after that relationship ended. "Sometimes you have to go through all this s--t to get your grips on life and figure out what the next boundaries in your love life are going to be," she says. "You have to go through the mud in order to find that peaceful place. In the long run, it was necessary for me to have more of a teammate."

Regarding her most recent breakup with singer-songwriter John Mayer, Perry hints that she will be singing about that one through new songs. "I have a lot of respect for [John] still, and I know it goes both ways. There's no bad blood, but I'm sure there will be inspired songs." (Mayer has already responded, saying, "You're supposed to write songs. You're just not supposed to tell everyone you're doing it.”)

Handler then asked Perry what's the longest she gone without sex. Her response? "Maybe six months or a year. I don't stay single for long."

For more on Perry's interview with Handler, pick up the July issue of Cosmopolitan.