It's been a nightmare, D. Scott Perrine told a judge yesterday.

There was the hungry cat. The depression that kept him on his couch, unable to function. And the five days he spent in jail that were a horror because of his past as a prosecutor, his current job as a defense lawyer and his homosexuality.

These were the arguments that Perrine used in an effort to convince Common Pleas Judge Joan Brown to release him on bail at a bench-warrant hearing.

Perrine was taken into custody on Friday after Brown issued a warrant for his arrest for failing to show up for two hearings in November on drug charges.

Yesterday, Brown denied Perrine's request for release and ordered him to undergo a mental- health and drug evaluation. The judge said that if Perrine can enroll in an in-patient drug-treatment program, she would consider transporting him immediately from jail to the treatment facility.

If he can't, he'll be placed in such a program by the court when he is brought before Brown on Dec. 23 for a status listing on his case.

She also issued an order for Perrine to be placed in protective custody, after he complained that his tenure as an assistant district attorney, his current job as a criminal-defense attorney and his sexual orientation have contributed to hardships while incarcerated.

"I have things going on in my house; I have a cat that hasn't been fed," Perrine said. "This has been a nightmare."

He told Brown that he failed to show up for his first hearing because of recent bouts with depression, and hadn't been aware of the second listing and the subsequent bench warrant that was issued.

The drug charges stemmed from an arrest last year in which he was charged with carrying contraband and possession of a controlled substance after prison guards at Curran-Fromhold Correctional Facility searched his briefcase before a client visit and found a vial of cocaine.

Perrine is representing one of the shooting suspects beaten in May by Philadelphia police as a news helicopter hovered overhead, capturing the incident.

Police told the Daily News Friday that Perrine had climbed onto the roof of his Center City home in an effort to escape when officers arrived to serve a warrant.

When he saw that he was trapped, he ran back inside the house and tried to squirm out of a basement window, cops said.

"These are Philadelphia police officers giving this testimony," Perrine said in court. "I haven't exactly been quiet in my approach to the Philadelphia Police Department."

He was referring to his remarks last May, when he spoke out against the police on behalf of his client Pete Hopkins, 20, who was one of three suspects jailed for attempted murder, aggravated assault, conspiracy and weapons offenses.

He said that some inconsistencies in the police reports on the suspects were the result of "sloppy police work or indicative of people with limited intellect trying to cover something up."

E. Marc Costanzo, the deputy attorney general prosecuting the case, said, "I'm satisfied that the court sees the gravity of the situation and the court has now taken steps to see to it that we evaluate him as soon as possible, and if he's in need of some sort of treatment that we're going to get him that treatment." *