how to clear the terminal

R

Robert Meyer

Hi NG,

sorry for my question, but i didn't found anything about how to clear the
terminal.
I try `clear`; in the script but this does not work.

Any ideas?

thx
Robert
 
B

Ben Morrow

Quoth Robert Meyer said:
sorry for my question, but i didn't found anything about how to clear the
terminal.
I try `clear`; in the script but this does not work.

See Term::ANSIScreen from CPAN.

Ben
 
B

Bryan Castillo

Robert Meyer said:
Hi NG,

sorry for my question, but i didn't found anything about how to clear the
terminal.
I try `clear`; in the script but this does not work.

system("clear"); # would probably work for you

I imagine that the clear command is printing ansi control characters
to stdout, so the back ticks would keep the control characters from
actually going to the terminal.
 
B

Bob

system("clear"); # would probably work for you

I imagine that the clear command is printing ansi control characters
to stdout, so the back ticks would keep the control characters from
actually going to the terminal.

Is there a cross OS solution?
 
H

Hobbit HK

Robert Meyer said:
Hi NG,

sorry for my question, but i didn't found anything about how to clear the
terminal.
I try `clear`; in the script but this does not work.

You can always print the output of clear:
print `clear`;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top