Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: how to erase screen output?

by mscharrer (Hermit)
on Jun 25, 2009 at 09:27 UTC ( [id://774650]=note: print w/replies, xml ) Need Help??


in reply to Re: how to erase screen output?
in thread how to erase screen output?

I would put the '\r' at the beginning not the end of the line:
print "\r$_/5" foreach (1..5); # and then: print "\n"; # or print ' 'x10, "\n";
This places the cursor at the end of the line not at the start. In this small example this does not make any difference but if the loop takes a second or so to process the cursor will be visible. Also following lines would overwrite the last line otherwise, which is not always wanted.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-16 19:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found