Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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.


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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://87688]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2018-06-19 22:49 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (115 votes). Check out past polls.