Robustness of complex networks to global perturbations