in reply to What is the wrong with the sleep function ?

With buffering on, output is only actually printed to the screen whenever a line finishes. So when you leave the \n in, everything is fine, but if you remove it, everything is buffered until the very end.
for (1..10) { print '.'; sleep 1; } $| = 1; # Turn off buffering for (1..10) { print '.'; sleep 1; }