axl163 has asked for the wisdom of the Perl Monks concerning the following question:
I have been searching for some sort of replacement for the sleep function but have not been successful. Any advice would be greatly appreciated.sub rotate_line { my $interval = 1; # Sleep time between twirls my $tcount = 0; # For each tcount the line twirls one incremen +t while ($interval) { $tcount++; print "$tcount\n"; switch ($tcount) { case 1 { printf '-'; sleep $interval; } case 2 { print "\\"; sleep $interval; } case 3 { print "|"; sleep $interval; } case 4 { print "/"; sleep $interval; } else { $tcount = 0; } } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Twirling baton progress indicator in Perl
by ides (Deacon) on Oct 10, 2005 at 23:20 UTC | |
by polettix (Vicar) on Oct 26, 2005 at 11:46 UTC | |
Re: Twirling baton progress indicator in Perl
by runrig (Abbot) on Oct 10, 2005 at 23:22 UTC | |
Re: Twirling baton progress indicator in Perl
by diotalevi (Canon) on Oct 10, 2005 at 23:25 UTC | |
| |
Re: Twirling baton progress indicator in Perl
by Aristotle (Chancellor) on Oct 11, 2005 at 00:24 UTC | |
by Tanktalus (Canon) on Oct 11, 2005 at 03:19 UTC | |
by Aristotle (Chancellor) on Oct 11, 2005 at 11:49 UTC | |
Re: Twirling baton progress indicator in Perl
by GrandFather (Saint) on Oct 10, 2005 at 23:26 UTC |