Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm not sure why you are passing an argument to your spin subroutine and then feeding that back around as you do. You are not returning any thing explicitly from the subroutine so the likelihood is that it returns 1 denoting success of the last print statement in the loop. You could make your subroutine into a closure, i.e. a reference to a subroutine, so that each time it is called it outputs the next symbol. That way, you don't have to worry about the looping logic in your subroutine but just call it whenever you want to show the next symbol. It is also probably a good idea to only show the next symbol once every 50 or 100 times around your logic loop, depending on the speed of that loop, as outputting a symbol every time will slow your program down.
I hope this is helpful. Cheers, JohnGG In reply to Re^3: Spinning cursor while waiting for search/copy process to be finished
by johngg
|
|