in reply to Implementing a buffered read-and-insert algorithm

It does sound like what you want is threads, where one thread is reading, and the other is loading, and they're sharing a buffer. Yikes.

It's not clear to me why you consider your buffered loader to be better than the more straightforward

while (<FH>) { $sth->execute(split(',')); }

Caution: Contents may have been coded under pressure.