http://www.perlmonks.org?node_id=311199


in reply to How to flush output to the console?

Turn on autoflush in a BEGIN block:

BEGIN { $| = 1 }