in reply to crafting a decent CLI

Check out Term::ReadKey and Term::ReadLine. I have not used them in a script yet, but the CPAN shell uses both.