Re: text on the screen
- From: Jim Gibson <jgibson@xxxxxxxxxxxxxxxxx>
- Date: Mon, 08 Aug 2005 15:58:05 -0700
In article <ScqdncFmgpsgWWjfRVn-vA@xxxxxxxxxx>, dave
<dave@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi all,
>
> New to Perl. I saw a perl program (not source code) output formatted text on
> the terminal in the way,
>
> # first time, output a line
> 23 11 1234
>
> # then, update 11 of above line with 22 at same place on screen
> 23 22 1234
>
> so, there is no position change for above two lines, but the contents
> updated. How to do this in Perl?
The simple way is to begin your output lines with "\r", do not end them
with the normal "\n", and write out the entire line each time. You
might add a few spaces at the end to move the cursor over and erase any
characters left over from an earlier, longer line. You should also turn
off output buffering with "$| = 1;".
For more complex schemes, use Curses as Jürgen suggested.
FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
.
- References:
- text on the screen
- From: dave
- text on the screen
- Prev by Date: Re: Which version of perl is recommended
- Next by Date: hot to post to form?
- Previous by thread: Re: text on the screen
- Next by thread: Which version of perl is recommended
- Index(es):
Relevant Pages
|
|