in reply to Translating Bash to Perl

You might want to take a look at Curses::Simp.