in reply to
DBD::ODBC - Why do i get an "out of memory" exception?
On the one hand, I do believe that the use of defined() in the original code is incorrect. But, on the other hand, I do not see from what has been presented here a valid cause for an “out of memory” condition. I suspect that the true cause of the problem lies within the body of the loop, and, unless you can actually, at-will reproduce the condition using exactly the code snippet you posted here, you should assume the same. Never “think you know” why a piece of code is screwing-up ... prove it.