Sheriff Michael Wood took the unusual step of convening court inside a G4S prisoner transport van for a hearing.
Staff were concerned that accused Jamie Wisbey could have scabies, or a similar transmittable condition.
Wisbey, 49, made no plea or declaration over allegations he had a crossbow in Perth, and was remanded in custody.
Wisbey, originally from Plymouth, gave his address as "no fixed abode".
He appeared on a petition alleging he had a crossbow in South Inch, in the centre of Perth, in the early hours of Monday morning.
He was also accused of having been in possession of a bow and arrows at the same place and time, and is charged with having a locking saw blade at the park at at Perth railway station.
His solicitor Billy Somerville had a brief consultation with his client inside the van, where Wisbey was kept in a plastic cell, before Sheriff Wood, the court clerk and procurator fiscal depute Joanne Smith joined them.
A court bar officer and a police officer were also present, but remained outside the van with G4S crew members while the private hearing was conducted.
The case was continued until a later date.
A sheriff moved his courtroom to the back of a van parked outside Perth Sheriff Court after fears were raised about an accused with a skin condition.