Naked rambler Stephen Gough denied breaching the peace by being nude in public - while standing naked in a court dock.
The 50-year-old was arrested in June and was charged with breaching the peace by being naked outside Perth Prison.
Gough was allowed into open court to discuss the case after members of the public were cleared from the courtroom.
After pleading not guilty to the charge, he was warned that he would not be allowed to conduct a public trial while he had no clothes on.
Sheriff Michael Fletcher warned him: "You should understand that a trial will take place in a public court here. You will not be allowed to attend without covering yourself. You better take that on board."
Gough, who stood naked and handcuffed to a Reliance officer, replied: "That's news to me."
The charge alleges that he refused to put clothes on when asked to do so by police officers and said he had indicated he had no intention of wearing clothing.
Gough from Eastleigh in Hampshire denied breaching the peace in Edinburgh Road, Perth, on June 18 and trial was set for July 16.