dvergin has asked for the wisdom of the Perl Monks concerning the following question:
The following script works as desired. It clears the screen, displays "foo" in the appropriate place. And then restores the console screen as it was before the program ran.
On the other hand, this next script is less well-behaved. After displaying "foo" and waiting 2 seconds, it complains "Curses function 'endwin' called with too many arguments at ./curses.pl line 10." and then leaves the console session in what I would describe as no_echo, no_eol mode (blindly typing 'ls -l' gives me a dir listing with no eol chars).#!/usr/bin/perl -w use strict; use Curses; initscr(); addstr(10, 10, "foo"); refresh(); sleep 2; endwin();
I would be glad for...#!/usr/bin/perl -w use strict; use Curses; initscr(); # omit this line for same result my $win = new Curses; #$win->initscr(); # including this causes no display $win->addstr(10, 10, 'foo'); $win->refresh(); sleep 2; $win->endwin();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: OO Curses Messes Up Console on Exit
by Paladin (Vicar) on Jan 20, 2003 at 05:15 UTC | |
|
Re: OO Curses Messes Up Console on Exit
by jepri (Parson) on Jan 20, 2003 at 04:57 UTC |