Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Time until event

by petral (Curate)
on Sep 19, 2002 at 21:56 UTC ( #199316=note: print w/replies, xml ) Need Help??


in reply to Re: Time until event
in thread Time until event

  "I wonder if printing out backspaces isn't the most efficient way to erase the line."

Actually, "\r" serves that purpose, unless you are overprinting in mid-line.   But even then, simply reprinting the unchanging beginning of the line still seems simplest.
eg,
printf(" %3d %s\r", $time, $line); while(--$time) { sleep 1; printf(" %3d\r", $time); } print"\n";
See this whirligig for a similar function.

  p

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2020-06-02 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (16 votes). Check out past polls.

    Notices?