Text this: Cosmological perturbation theory and the variational principle in gravitation