Jan 5, 2011, 11:21 PM
Post #1 of 1
Greetings all, I want to execute perl code from within a java application. For example I pass the following command to my java application:
Running perl from java
perl somescript.pl args...
This works fine and I am able to capture the script's output in my java code. However if I use the "-e" command-line option, the perl program is successfully executed but my java program shows that no output is produced. For example:
perl -e "print \"Hello World\""
My guess is that the perl interpreter works differently with the "-e" option than it does when reading and executing a perl script. I would like someone to tell me how to run a perl program using the "-e" option and capture its output in my java code. I am running perl 5.8.6 for MSwin32-x86-multi-thread on Microsoft Windows 2000 Version 5.00.2195 and Sun Microsystems java version 1.6.0_21