After being kicked out of his home and finding himself both homeless and without money, a Scarborough man returned to the flat to raid the fridge.
Then after being bailed by the police, Jamie Hornby entered another property, stealing items to a value of £1,500, again in order to support himself.
However, he was caught after using a mobile phone taken in the second burglary to ring for a taxi, the police being able to trace the call and arrest him as he sat waiting for his ride.
Hornby appeared before York Crown Court for sentencing, after having previously pleaded guilty to two charges of burglary.
The court heard that Hornby, a three-strike burglar, was also asking for three other offences to be taken into consideration - two shed burglaries and a theft.
Alan Mitcheson, prosecuting, told how after being asked to leave his flat in Milton Avenue, the landlady having then changed the locks, did not stop Hornby finding an insecure window on November 4, last year, and entering to raid the fridge.
He was caught by a resident and reported, but bailed, only to then enter the home of a stranger in Filey Road through an insecure door on December 10, stealing a laptop, mobile phones, a handbag and other items.
Andrew Semple, mitigating, said that his client was realistic about the trouble he was in.
He said that, after his last release from a custodial sentence, Hornby had been homeless, estranged from his family and soon used up his welcome sofa-surfing with friends.
However, he eventually found the flat in Milton Avenue, but was asked to leave after a mix-up with his benefits meant the rent was not being paid.
Passing sentence, Judge Neil Clark said that he had read that Hornby had felt “worthless” at the time he had committed the burglaries.
However he was also informed that he had been trying to better himself in prison and had a promise of a job with a former employer on his release.
Hornby was jailed for three years - which is the minimum sentence for a three-strike burglar.