check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!
10 Responses to “clear the screen in perl”
on 08 Jul 2008 at 10:36 am Biteybiteybitey
Tried it and it come up as “‘clear’ is not recognized as an operable external command, operable program or batch file”
Replaced “clear” with “cls” (DOS clear screen) and it works fine.
on 04 Aug 2008 at 3:15 pm Marx0r
Indeed, system(‘clear’) works only on Unix-based systems. So for multiplatform programs, that’s _not_ good.
Printing the Form Feed (ASCII: 12) character should do the trick. I haven’t tried that, though.
on 07 Dec 2008 at 9:32 pm Marc
on windoze try system(“cls”)
on 01 Feb 2009 at 9:09 pm Sameer
Thanks Marc, system(“cls”) works in Windows.
on 09 Feb 2009 at 7:25 pm nj
windoze…zzz
on 08 Apr 2010 at 11:34 am Brandon
Printing the Form Feed character (\f) doesn’t appear to work in Windows. It adds an ‘ankh’ or ‘venus’ symbol to the screen.
CODE:
print “This text should not be visible”;
#print “14″;
#print “\xC”;
print “\f”;
print “This page left blank intentionally.”;
OUTPUT:
This text should not be visible♀This page left blank intentionally.
on 08 Apr 2010 at 11:36 am Brandon
That first commented print statement didn’t post accurately. It should be a backslash followed by the octal 014.
Tried it and it come up as “‘clear’ is not recognized as an operable external command, operable program or batch file”
Replaced “clear” with “cls” (DOS clear screen) and it works fine.
Indeed, system(‘clear’) works only on Unix-based systems. So for multiplatform programs, that’s _not_ good.
Printing the Form Feed (ASCII: 12) character should do the trick. I haven’t tried that, though.
on windoze try system(“cls”)
Thanks Marc, system(“cls”) works in Windows.
windoze…zzz
Printing the Form Feed character (\f) doesn’t appear to work in Windows. It adds an ‘ankh’ or ‘venus’ symbol to the screen.
CODE:
print “This text should not be visible”;
#print “14″;
#print “\xC”;
print “\f”;
print “This page left blank intentionally.”;
OUTPUT:
This text should not be visible♀This page left blank intentionally.
That first commented print statement didn’t post accurately. It should be a backslash followed by the octal 014.
14 Clear in perl on windows 7
Does the content code (One shown for issue) apply/work for a macintosh?
ClearPores facial cleansing system
clear the screen in perl » from the desk of stinkpot