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


in reply to testing functions that prompt user or call external commands

I think you can use Test::Expect.