# commit in 1000-row chunks if ($row and ($row % $COMMIT_CHUNK_SIZE == 0)) { $dbh->commit; }
That code is supposed to commit a transaction every $COMMIT_CHUNK_SIZE rows. It would work great if $row was the row count. Unfortunately for me, $row was actually an ARRAY ref, which meant that the commits never happened (or happened on every row, if the pointer in $row happened to be an even multiple of $COMMIT_CHUNK_SIZE). Even more unfortunately, this usually didn't matter because MySQL was able to handle quite a lot of inserts in a single transaction. That is, until it couldn't, and blew up with a buffer size error in the middle of an 8-hour job.
Here's what I would have liked to see when that code ran:
Warning: numifcation of a reference at line 100.
Intentional numification of a reference is so rare, and unintential numification is so common that I think this makes a heck of a lot of sense as a warning. If my head of steam lasts long enough I may work up a patch.
And may I also say, AAAAAAAAAAAAAAAAARRRGGGRHHH.
Thank you.
-sam
In reply to The trap of reference numification by samtregar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |