Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Another Program From Perl

Status
Not open for further replies.

JBHusted

Programmer
Nov 5, 2001
1
US
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."
 
#
# Start DeriveIt

system ("\\DeriveIt\\NESimulatorLite\\NESimulatorLite.exe");

notice the \\
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top