Connecting orbits in perturbed systems