while(1) { # Do my stuff (e.g., constant screen updates) $cui->do_one_event(); }