A doctor has been sentenced to eight months of home confinement over the fatal overdose of Friends star Matthew Perry after pleading guilty to a drugs charge.