I need to run a Java program from Perl. However, that Java program requires user input. How do I get the prompts ("Enter SomeData. . ." from Java to show up when running it from Perl? Backticks/System/Exec don't seem to do the trick. . .
well, basically you'll have to open a bi-directional pipe to the process, which you can read about in the perl faqs. the caveat there being that wait times will be unregulated, and you may send input at the wrong time. it would be better to rewrite the java program to work in a batch mode, just accepting a line-separated series of inputs and figuring out how to use it from there.
if you have problems with a bi-directional pipe, post your questions about that.
HTH "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.