An armed robber was so well-known in the store he was holding up that he was able to ask the shop assistant by name to hand over the cash.
David Bacon was jailed for 16 months after admitting storming into the shop and saying: "Jason, I hate to do this, but I'm taking the money."
Bacon, 25, subsequently sent a letter of apology to the staff worker he knew.
Perth Sheriff Court was told he held up his local shop in Almondbank, near Perth, for £285 and a phone.
Bacon, a prisoner at Perth, admitted robbing the Bridgeton Store at knifepoint on 8 August and assaulting Jason Elgumaty, 36, by presenting the weapon at him.
In his letter, Bacon wrote: "I am writing to apologise for what I did at your shop on 10 August. Could you let Jason know I'm sorry for what I have put him through.
"I feel guilty and ashamed and I truly regret what I have done. I know there's nothing I can do or say that will change the situation but I feel I owe you an explanation."
Bacon explained that he had been "heavily dependent on drugs" when he robbed the store.
Fiscal depute Alan Kempton said: "The accused had entered the shop on several occasions and had been acting suspiciously within the shop.
"The accused was known to the complainer as David Bacon. He was known by name. The accused entered and appeared to be desperate.
"He produced what was described as a large kitchen knife, with a smooth blade around seven or eight inches long. He brandished the knife towards the complainer and was one foot away."
Mr Kempton said Bacon appeared nervous, so Mr Elgumaty stepped back and the accused helped himself to £285 from the till. He took the phone to avoid the shop worker calling for help.
Solicitor Linda Clark said Bacon had a girlfriend and a job, but had lost both and had returned to taking heroin which had fuelled his need for cash.
Sheriff Jack Brown told Bacon he would be failing in his public duty to protect shop workers if he did not lock him up and he was jailed for 16 months.