15.3. Clearing the Screen15.3.2. SolutionUse the Term::Cap module to send the appropriate character sequence. Use POSIX:: Termios to get the output speed of the terminal (or guess 9600 bps). Use eval to trap any exceptions that arise using POSIX::Termios.
Or, just run the clear command:
15.3.3. DiscussionIf you clear the screen a lot, cache the return value from the termcap or clear command:
Then you can clear the screen a hundred times without running clear a hundred times: print $clear; 15.3.4. See AlsoYour system's clear(1) and termcap(5) manpages (if you have them); the documentation for the standard module Term::Cap module, also in Chapter 32 of Programming Perl; the documentation for the Term::Lib module from CPAN
Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|