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


in reply to how to send input to stdin automatically?

I think you'll need to look at Expect (or one of its variants).