Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: making a spinner

by blakem (Monsignor)
on Sep 20, 2001 at 22:40 UTC ( [id://113666]=note: print w/replies, xml ) Need Help??


in reply to making a spinner

This seems to work on my unix VT100 terminal. It involves unbuffering the output, and printing the '\b' or backspace char.
#!/usr/bin/perl -wT use strict; $| = 1; # unbuffer output my $spinner; my @spinState = ("-", "\\", "|", "/"); print "Working: "; foreach(1..25) { print "$spinState[$_%@spinState]"; sleep 1; print "\b"; # backspace }

-Blake

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://113666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-26 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found