in reply to seek() command on STDOUT
After reading the posting again and again, I think that you really search for a progress bar or something like that. You want to move the cursor and change a character on the (virtual) terminal. And seek just don't let you do that. Am I right?
If yes, you are searching for information about terminal control codes. One of the most primitive ones is the backspace, and it works on nearly every terminal. Stupid example:
#!/usr/bin/perl -w use strict; $|=1; my @spinner=qw( / - \ | ); print "Wait ... "; for my $i (0..19) { print "$spinner[$i % 4]\b"; sleep 1; } print "- done\n";
There are much more terminal control codes. Unless you work with exotic hardware or exotic operating systems, the generic VT100 or xterm codes will work. There are libraries that take care of the actual codes, like termcap and the newer http://en.wikipedia.org/wiki/Terminfo. Libraries like curses and the newer ncurses add functions for text mode user interfaces. You can get Perl interfaces for all of those libraries on CPAN.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: seek() command on STDOUT
by ybnormal (Novice) on Apr 30, 2010 at 21:21 UTC | |
by BrowserUk (Patriarch) on Apr 30, 2010 at 21:46 UTC | |
by ybnormal (Novice) on May 01, 2010 at 04:02 UTC |