Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Resetting your Terminal for each line printed

by liverpole (Monsignor)
on Sep 27, 2006 at 11:02 UTC ( #575125=note: print w/ replies, xml ) Need Help??


in reply to Resetting your Terminal for each line printed

Hi ghenry,

From your question:

    (by adding print ' ' x 80;)

it looks like you mean you wish to clear to the end of the line, is that correct?

If so, use <escape>[K like so:

print "\e[K";

Some of the escape sequences I use all the time are:

print "\e[H"; # Put the cursor on the first line print "\e[J"; # Clear from cursor to end of screen print "\e[H\e[J"; # Clear entire screen (just a combination +of the above) print "\e[K"; # Clear to end of current line (as stated +previously) print "\e[m"; # Turn off character attributes (eg. color +s) printf "\e[%dm", $N; # Set color to $N (for values of 30-37, or + 100-107) printf "\e[%d;%dH", $R, $C; # Put cursor at row $R, column $C (good fo +r "drawing")

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/


Comment on Re: Resetting your Terminal for each line printed
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (18)
As of 2014-07-23 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (145 votes), past polls