in reply to Top like display with Curses

Generally you should only call initscr once. The other problem is that you're calling erase followed by refresh. Your program should have this structure:
use Curses; initscr(); while (1) { erase(); ...draw new screen using addstr, etc.... refresh(); sleep(2); } endwin();
refresh is where the screen is actually changed. erase and all the other drawing commands just change an in-memory copy of the screen.

Replies are listed 'Best First'.
Re^2: Top like display with Curses
by mhearse (Chaplain) on May 21, 2008 at 18:19 UTC
    Works great! Thanks.