Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: sleep in while loop

by Shendal (Hermit)
on Aug 05, 2002 at 16:06 UTC ( #187721=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: sleep in while loop
in thread sleep in while loop

You may be getting bitten by buffering. Try this:

$|++; # force auto-flush (see perldoc perlvar) while (1) { if ($cond == 1) { print "1\n"; } else { print "2\n"; } sleep 10; }

Cheers,
Shendal


Comment on Re: Re: Re: sleep in while loop
Download Code
Re: Re: Re: Re: sleep in while loop
by Anonymous Monk on Aug 05, 2002 at 16:10 UTC
    Thanks - buffering was biting my proverbial ***- by the way the code in the loop was not the actual code - sorry to confuse the issue.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://187721]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2015-07-04 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls