lafont99 has asked for the wisdom of the Perl Monks concerning the following question:

I am using using an executable, this exec sends me prompts that I have to give reply. I am new at perl and cannot figure out how to interact with these prompts, can someone provide me with a sampl or at least point me to the right direction, sorry for my english. ths Rejean

Replies are listed 'Best First'.
Re: interact with a UNIX pgm
by IlyaM (Parson) on Dec 27, 2002 at 15:09 UTC
Re: interact with a UNIX pgm
by diotalevi (Canon) on Dec 27, 2002 at 15:13 UTC
Re: interact with a UNIX pgm
by thor (Priest) on Dec 27, 2002 at 16:52 UTC
    You don't necessarily need to pull out perl. Try this from the shell:
    name_of_cmd <<END answer_to_question_1 answer_to_question_2 answer_to_question_3 answer_to_question_4 END
    This works if you know the answers ahead of time. If you need to make decisions based on the output of the program, then Expect.pm is your baby.

    thor

      Well, I look at the expect seems that I have a lot of preliminary work to do, need MCPAN, need to download module and install them I am always missing some module or tool to do the Makefile.PL I tried the other option wiht the shell, but it seems that my UX program eats all the answer on the first prompt then he gives me my second question and I do not have anything left to answer, should I be putting some kind of control character after the first answer to stop the program from eating all my answer at once ?