-----Original Message-----
From:   Chris Devers [mailto:[EMAIL PROTECTED]
Sent:   Wed 2/9/2005 8:01 PM
To:     TapasranjanMohapatra
Cc:     Perl Beginners List
Subject:        Re: while(1){print "a"; sleep 1;}
On Wed, 9 Feb 2005, TapasranjanMohapatra wrote:

> Why I dont get a's printed with the code below?

Apparently it's an output buffering issue.

If you flush output, it works:

  $ perl -e 'while(1){print"a";sleep 1}'
  ^C
  $ perl -e '$|=1;while(1){print"a";sleep 1}'
  aaaaaaa^C
  $

So, setting $| to 1 seems to fix the problem...


-- 
Chris Devers


Thanks Chris,
Forcing the flush after print solves the problem.
Tapas


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to