Sean Kerr attacked his victim in Ropemakers Close after his life "went Pete Tong," Perth Sheriff Court heard.