Green's-function method for the Helmholtz equation with perturbed boundary conditions