Prison seemed to be the only option for a homeless man who was found "passed out" in long grass at the back of a Whanganui resident's house.
Dean John Sayers pleaded guilty to three counts of unlawfully entering an enclosed yard or area, when he appeared in the Whanganui District Court on Tuesday.
Police prosecutor Senior Constable Graham Hoskin said Sayers was walking around a residential area in Whanganui on February 2 when he went up a long driveway and was discovered by the owner.
He left and the same thing happened at another residential address.
Mr Hoskin said the next night he was located in long grass at a residential address on Peat St and had been drinking.
Defence lawyer Stephanie Burlace said Sayers was trying to find somewhere safe to sleep for the night.
"He hasn't had a home for a while now and has been held in custody for the last two weeks."
Ms Burlace referred to a letter Sayers had written to the judge explaining his situation.
Judge Philip Crayton said he had read the letter and said it was obvious that at Sayers' age he needed to find a job and somewhere to live.
Judge Crayton said he was concerned he would leave the court, still with nowhere to live and repeat the offences.
"He is spending all his money on alcohol and scaring residents by passing out in their backyard."
Judge Crayton said the presumption was if someone is breaking into private property they were usually looking for something to take.
"It would be most unfortunate if you did find yourself back in court for burglary because you can guarantee the consequence would be prison."
Ms Burlace said he had some money but still no address.
"There is the potential for setting him up for failure if we don't get the right sentence."
Judge Crayton convicted Sayers and sentenced him to one month's imprisonment.