Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: full screen UI in perl

by stephen (Priest)
on Jun 12, 2001 at 04:19 UTC ( #87688=note: print w/ replies, xml ) Need Help??


in reply to full screen UI in perl

If you're displaying on an ANSI terminal, you can also use Term::ANSIScreen to move the cursor around. Here's a sample that clears the screen, prints "Hello" at column 10, row 10, pauses, then prints "Bye" on the same line.

use strict; use Term::ANSIScreen qw(:cursor :screen); $| = 1; cls; locate(10, 10); print "Hello"; sleep(1); locate(10,10); clline(); print "Bye"; sleep(1);

Update: Turned off buffering (which was causing some problems) and added example for clline.

stephen


Comment on Re: full screen UI in perl
Select or Download Code
Re: Re: full screen UI in perl
by chip (Curate) on Jun 12, 2001 at 04:43 UTC
    Wouldn't you be better off setting $| = 1 then printing without the newlines?

        -- Chip Salzenberg, Free-Floating Agent of Chaos

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-07-29 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls