in reply to Twirling baton progress indicator in Perl

This isn't a problem with sleep so much as a problem with buffered output. Printing a single character isn't filling up your buffer.

Add this to the top, but inside, your while statement:

$| = 1;
This forces a flush right away after every print statement.

Frank Wiles <frank@wiles.org>
http://www.wiles.org

Replies are listed 'Best First'.
Re^2: Twirling baton progress indicator in Perl
by polettix (Vicar) on Oct 26, 2005 at 11:46 UTC
    ... and if some spare time is available, probably a look to Suffering from Buffering? by Dominus is a way to spend it well.

    Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Don't fool yourself.