Modular functionals and perturbations of Nakano spaces