Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: full screen UI in perl

by stephen (Priest)
on Jun 12, 2001 at 04:19 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://87688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found