in reply to Re: Spinning cursor while waiting for search/copy process to be finished
in thread Spinning cursor while waiting for search/copy process to be finished
Thank you very much, Ken. I tried a few options - wouldn't work :(. The best thing I can do is to have it rotate indefinitly - and I want it to stop after the process is over (and I don't know when). I even made the simpliest code I could to test it:
#!usr/bin/perl use Time::HiRes; $|=1; #autoflush sub spin { my ($arg) = @_; $|++; for (my $x = 0; $x <= $arg; ++$x){ foreach (("-", "\\", "|", "/")){ print $_; Time::HiRes::sleep (0.1); print "\b"; } } #print " \n"; } my $i = 1; print "Please wait..."; my $j = 0; for ($i = 1; $i <= 10000; $i++) { $i++; $j=&spin($j); } print "Done\n";
I know I keep on missing something important... What?
|
---|
In Section
Seekers of Perl Wisdom