In this case, the mysql LOAD DATA syntax command appears to be the way to go as another responder has already suggested. The replies that suggest using perl classes are missing the point that the database just can't take all those inserts - that's why databases come with bulk loading facilities.
well, that's the direction i'm going, it seems. i tried a few other things that *might* have freed up DB resources, but after about 20 minutes of running the job, the memory usage spiralled out of control.