I am looking for Perl implementation in Java. Something like Jython is for Python. I found PLJava but it needs both JVM and Perl compiler installed. I need something which does not need a Perl compiler.
I need to run some Perl code in a Java class.
UPDATES:
- I figured out that PLJAVA is what I need. Does anybody know some tutorial?
- Has anybody played with the Inline::Java module.
- I also could not install Inline::Java.
Jython isn’t fully compatible with CPython (or whatever you would rather call the original C++ Python interpreter), but wherever either differs from the language spec is a bug. Unfortunately, Perl 5 is much more complex and lacks any formal language specifications at all — the language effectively being defined as ‘what does the
perlexecutable do’ — so there exists no other implementation of the Perl 5 language aside from the Perl 5 interpreter. Unfortunate, but that’s history. Perl 6 does have a language spec and multiple (incomplete) implementations, but that’s not likely to be useful to you.PLJava was an attempt to do exactly what you want, call Perl from Java. It does so via JNI (stuffing native code into Java) linking to
libperl. However, it’s not been updated since 2004 and I don’t know how well it works.Edit
I hadn’t seen Inline::Java::PerlInterpreter before — unfortunately it doesn’t seem to work with my system Perl.