title: Test fails under prove if it writes to stdout without newline
body: <p>When I run a perl test using the <code>prove</code> utility, it fails if the method under test contains <code>print</code> statements that are not terminated by newlines.</p>
  
  <pre><code>use Test::More tests=&gt;1;
  
  ok(foo(), "calling foo");
  
  sub foo{
      print "A";
      1;
  }
  </code></pre>
  
  <p>This results in</p>
  
  <pre><code>Bad plan.  You planned 1 tests but ran 0.
  </code></pre>
  
  <p>If I append a newline: <code>print "A\n";</code> the test passes.</p>
  
  <p>(Note that if I simply execute the test <code>perl mytest.t</code> rather than using <code>prove</code> it passes either way).</p>
  
  <p>Any ideas why this might be, and how to work around it?</p>