I have a computationally expensive task in perl, and would like to inform the user that computation is ongoing by printing out a period after each portion of the computation is
What worked for me was to put the line
STDOUT->autoflush(1);
before my line
print ".";
inside my existing loop. Didn't use the sleep for fear of slowing the things down even more.