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:
Perl is a cross-platform environment and library for running JavaScript applications which is used to create network and server-side applications.
Perl is a high-level, general-purpose, multi-paradigm, interpreted, dynamic programming language. Java is a high-level, general-purpose, mostly single-paradigm, statically typed programming language.
For the first pattern, Perl is about 10X faster than Java; for the second, they are about the same. In general, Perl uses a backtrack regex engine. Such an engine is flexible, easy to implement and very fast on a subset of regex.
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 perl
executable 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.
I hadn't seen Inline::Java::PerlInterpreter before -- unfortunately it doesn't seem to work with my system Perl.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With