How can I call Perl from Java?

前端 未结 9 1702
自闭症患者
自闭症患者 2020-12-04 22:42

I have a Perl module that I would like to use from Java. Is there a way to call this code using either ActiveState Perl on Windows or the generic Perl that comes with Linux?

相关标签:
9条回答
  • 2020-12-04 23:37

    Sleep is a scripting language with an interpreter that runs in the JVM. From what I understand the Sleep language is basically Perl with some extensions. Your code may be able to run in Sleep. If it does you can instantiate the interpreter, run the code and retrieve the result.

    0 讨论(0)
  • 2020-12-04 23:43

    I don't know how stable will that be ,or how well maintained it is, so, another option would be to write a script that does something your application will need and then execute that script from Java. Not the most elegant way, but it works.

    0 讨论(0)
  • 2020-12-04 23:44

    I found an implementation on JavaWorld by Robert Lawson, which uses XML-RPC to call Perl routines from your Java code: Call Perl routines from Java

    0 讨论(0)
提交回复
热议问题