in reply to Perl only prints complete lines?

You're hit by line buffering of STDOUT. Try $| = 1 before the loop.