title: Can you force flush output in Perl?
body: <p>I have the following two lines in Perl:</p>
  
  <pre><code>print "Warning: this will overwrite existing files.  Continue? [y/N]: \n";
  my $input = &lt;STDIN&gt;;
  </code></pre>
  
  <p>The problem is that the print line does not get executed before the Perl script pauses for input. That is, the Perl script just seems to stop indefinitely for no apparent reason.I'm guessing that the output is buffered somehow (which is why I put the \n in, but that doesn't seem to help).</p>