Periodic perturbations of scalar second order differential equations