tags:

views:

297

answers:

6

Hi,

Is there any way to execute perl code without having to use Runtime.getRuntime.exec("..."); (parse in java app)?

A: 

No, I don't believe this exists. While there have been several languages ported to the JVM (JRuby, Jython etc) Perl is not yet one of them.

Nathaniel Flath
+4  A: 

this looks like what you're asking for

Joel
+5  A: 

I've been looking into this myself recently. The most promising thing I've found thus far is the Inline::Java module on CPAN. It allows calling Java from Perl but also (via some included Java classes) calling Perl from Java.

Michael Carman
A: 

I could have sworn it was easy as pie using the Java Scripting API.
But apparently it's not on the list of existing implementations...

So, maybe this helps instead : java and perl
edit: i said "maybe"

Stroboskop
The JPL is dead. Don't use it. Inline::Java is the way to go.
daotoad
+3  A: 

Inline::Java provides an embedded Perl interpreter in a class. You can use this to call Perl code from your Java code.

Graciliano M. Passos' PLJava also provides an embedded interpreter.

Don't use JPL (Java Perl Lingo)--the project is dead and has been removed from modern perls.

daotoad
A: 

In the future, the standard way to use any scripting language is through the java Scripting Support introduced in JSR 223. See the scripting project homepage for a list of scripting languages supported at the moment. Unfortunately, Perl isn't on there yet :-(

toolkit