A 70-year-old man has been taken away from a Perth court in an ambulance after collapsing when told he was being jailed for passing on confidential information about a corruption inquiry.

Hervey Alan Harms had pleaded guilty to more than 30 charges of disclosing restricted information about a Corruption and Crime Commission (CCC) investigation involving the City of Perth.

Harms, the director of a Perth electrical contracting company, also admitted two charges of giving false testimony to the CCC.

Perth Magistrates Court was told Harms disclosed information in telephone calls to more than a dozen people, ignoring an order made by the CCC.

The information included telling people the CCC was using surveillance and telephone intercepts.

Harms's lawyer Patti Chong said her client suffered from depression, anxiety and panic attacks, and he had felt "overcome" by the CCC investigation.

"That led him to feel the need to unburden himself and disclose information," she said.

However, when Chief Magistrate Steven Heath told Harms the offences were so serious he was going to receive an immediate jail term, Harms collapsed on the floor.

The court was adjourned and an ambulance called to take Harms to hospital.

His wife Margaret, who stood beside him in court, also pleaded guilty to two charges of disclosing restricted information.

She has yet to be sentenced.