This page describes that the focal length does not cause perspective distortion. This page describes that an orthographic projection (which affects perspective) leads if you increase the focal length and the camera distance to infinity. So what is the mathematical relationship between focal length, camera distance and perspective projection?

P.S: If changing the focal length does not affect the perspective of the image, how does this affect the perspective distortion of the image?