sleep () and print ()

2001-06-16 Thread Jim Gallott

I am apparently missing something.  I used the following lines in a program, 
with the intention of the output to screen pausing 1 second, then printing 2 
line returns and 'The result is:', then pausing another second, then 
continuing with the rest of the printing.  What it does is pause one second, 
do the 2 line returns, wait another second, then do all the printing 
together.  I obviously have something wrong, but don't know what.

Section of code:

sleep (1);
print "\n\nThe result is:";
sleep (1);

print "\n\nI was home alone. etc, etc.
-- 
Jim Gallott
West Meadows Farm, New Haven VT
[EMAIL PROTECTED] http://www.westmeadowsfarm.com



Re: sleep () and print ()

2001-06-16 Thread Jim Gallott

Thank you.  worked like a charm.

On Saturday 16 June 2001 12:52, Me wrote:
> > I am apparently missing something.
>
> Being aware of buffering, I suspect.
>
> Various parts of the 'pipe' between your print
> statements and the final destination do some
> sort of buffering. You can switch some of this
> off in perl by specifying:
>
> $| = 1;

-- 
Jim Gallott
West Meadows Farm, New Haven VT
[EMAIL PROTECTED] http://www.westmeadowsfarm.com