The most accurate short answer is maybe.

On Linux Mandrake 8.0 through PuTTY and on Windows 98 SE with ActiveState build 623 I didn't need to flush buffers doing something similar. Different term types on different systems will do different things with the code I used. Considering the problem you are having, I'd say flushing buffers is a good idea. The $| variable is probably your very best bet, although the Term modules, Curses module, or possibly a few other things could help. I won't mention the other things, because using the three I already mentioned should be more than enough to get the job done and are widely used. There are, in the Perl spirit, even more ways to do it, but you probably will never need to use them. ;-)

Just in case you're curious, here's the Linux test code I used:
perl -e 'for (a..fred) { print "$_\r" } print "\n"'
...and here's the Windows 98 code:
perl -e "for (a..f) { sleep 1; print qq{$_\r} } print qq{\n};"
or
perl -e "for (a..fred) { print qq{$_\r} } print qq{\n};"

In reply to Re: print problem by mr_mischief
in thread print problem by Punto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.