Home > Archive > PERL Beginners > January 2006 > perl-java interface...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
perl-java interface...
|
|
|
| I need to connect to a perl program and receive two values.
The perl modules for JAVA I looked at appear to be used to send JAVA
instructions from perl. I don't need to do this, just run the java
class and get values passed back and forth.
I know I can connect using the system command as such:
perl:
#!/usr/local/bin/perl
use CGI qw/:standard/;
($java_value1,$java_value2)= system("java HelloWorldApp");
print $java_value1;
print $java_value2;
java:
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World from the HelloWorldApp
class!");
String value_to_be_passed1 = "I am here";
String value_to_be_passed2 = " and here too";
}
}
The HelloWorld print works fine, but no value is passed.
Any suggestions? I also need to do the reverse, from perl to java....
| |
|
| Nooby wrote:
> I need to connect to a perl program and receive two values.
> The perl modules for JAVA I looked at appear to be used to send JAVA
> instructions from perl. I don't need to do this, just run the java
> class and get values passed back and forth.
perldoc -q "Why can't I get the output of a command with
system()?"
|
|
|
|
|