in reply to ncurses dilemma
Sounds like your output is buffered. See the documentation for $| or just use something like:
use IO::Handle; STDOUT->autoflush(1); [download]