Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have no idea where I can find it, nor what have to look for. I want to show a bunch of changing values on the console, but I don't want to write again and again new lines as print would do it.

Does s.o. here can give me hint how to do or a link to some code that a part of the console is like a fixed table and not a bunch of lines where a new line pushes all the previous lines one line up. (On my SuSE Linux pocinfo -f does this)

Thanks in advance,
Carl

Replies are listed 'Best First'.
Re: organize console as a fixed table
by dreadpiratepeter (Priest) on May 02, 2004 at 22:37 UTC
    You want to look at Curses. It does the screen manipulation you want.


    -pete
    "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."
Re: organize console as a fixed table
by Wassercrats (Initiate) on May 03, 2004 at 00:07 UTC
    Aside from curses stuff, there's these modules that let you use ANSI escape sequences. Here are some features of Term::ANSIScreen:
    The :cursor function set locate [EXPR, EXPR] Sets the cursor position. The first argument is its row number, and th +e second one its column number. If omitted, the cursor will be locate +d at (1,1). up [EXPR] down [EXPR] left [EXPR] right [EXPR] Moves the cursor toward any direction for EXPR characters. If omitted, + EXPR is 1. savepos loadpos Saves/restores the current cursor position. The :screen function set cls Clears the screen with the current background color, and set cursor to + (1,1). clline Clears the current row with the current background color, and set curs +or to the 1st column. clup Clears everything above the cursor. cldown Clears everything below the cursor.

    The instructions didn't make it clear that it wouldn't work on Windows XP, so it made me waste alot of time, but maybe it will work for you.

      Thanks guys,

      you're really great,

      Carl
Re: organize console as a fixed table
by Fletch (Bishop) on May 02, 2004 at 23:57 UTC