in reply to for-loop question

I can't tell you what the errors mean since you haven't shown us what they are nor any of the code that causes them. But I have a pretty good guess about how you can get those printed lines to appear when you want them. First add the line
$| = 1;
at the beginning of your program, then change your print statement to something like
print "Doing table $_\n";
This will make sure that your print output is not buffered, which is probably the problem you're having now.