#see also http://perl.plover.com/FAQs/Buffering.html use strict; use warnings; #prints, waits a second, prints for (1..3) { sleep 1; print "$_\n"; } #without the newline, waits the entire time and then prints the whole thing. for (1..3) { sleep 1; print "$_"; } $| = 1; #now it works for (1..3) { sleep 1; print "$_"; } #you might want to go back to the default behavior now. $| = 0;