In two of my mathematical physics textbooks on QFT, when solving the Klein-Gordon equation over the infinite line, the authors (Wald and Parker/Toms) take the Klein-Gordon equation and place the field in a box of length $L$, and then apply periodic boundary conditions: $\phi(-L,t) = \phi(L,t)$. To recover the solution over the real line $-\infty < x < \infty$, they then say one can just take the limit as $L \to \infty$.
I don't understand how this can work. Solving with periodic B.C.'s you'll get eigenfunctions that look like $\sin(a x / L)$, and as $L \to \infty$ these will vanish.
Any ideas on what they are implying with this "convenient mathematical device" as they call it?
Thanks.