in reply to perl code to automate launching a program and entering responses
Here's a link that you might find helpful. Chapter 1 covers "Hello World" and program structure which, combined with the other responses to your post, should get you started on your own.
In Section
Seekers of Perl Wisdom