title: Carriage return \r in bash terminal printing from perl script causing freeze
body: <p>I'm printing progress from a perl script in bash using Ubuntu 12.04. When I use this:</p>
  
  <pre><code>foreach my $filename (sort @files) {
      print "Processing $filename...\n";
  </code></pre>
  
  <p>it prints each progress line with a gap of ~2 secs between each print, and that's fine. But there's a good few files, so it's noisy. I tried to use this instead:</p>
  
  <pre><code>print "\rProcessing $filename...";
  </code></pre>
  
  <p>but now I get no output at all until the script has gotten to the last file, and then that's the only print statement that I see (the last one). Incidentally, I don't care about erasing the previously printed statement because each will be exactly the same length.  </p>
  
  <p>However, I can do <code>seq 1 1000000 | while read i; do echo -en "\r$i"; done</code> in bash and it works fine. </p>