As
Skeeve pointed out, it would be helpful if you could display more of your code. When I turn on
warnings and
strict, the following things haven't been defined (at least, within the code fragment you showed):
You might also consider trying it on a smaller subset of data first, just to narrow the problem.
Finally, perhaps you might want to try not wrapping lines, to make the code a little easier to examine (though I admit this is my preference, not everybody's).