http://www.perlmonks.org?node_id=443366


in reply to Edit STDIN

I think you need some terminal-aware modules like Term::Readline.

Alberto Simões