从java调用Perl,主要用于正则表达式匹配 [英] Call Perl from java, mainly for regular expression matching
问题描述
我想从Java有效地执行Perl代码。 Perl的目的主要是执行正则表达式匹配(在某些测试中,Perl比Java更有效)
I'd like to execute Perl code efficiently from Java. The purpose of the Perl is mainly to perform regular expression matching (in some tests it Perl was more efficient than Java to do that)
到目前为止,我发现了这种可能性使用这个:
http://metacpan.org/pod/Inline :: Java :: PerlInterpreter
Thus far I've found the possibility of using this: http://metacpan.org/pod/Inline::Java::PerlInterpreter
另一种选择是使用java中的Runtime.exec()来调用Perl。
Another option would be to use Runtime.exec() in java to call Perl.
什么是性能最佳的解决方案?一个人比另一个人有优势吗?我不能真正看到任何东西,除了PerlInterpreter仍然是实验性的,我不知道这是否会改变。
您是否知道从Java调用Perl的任何其他选项?
What is the most performant solution? Does one have an advantage over the other? I can't really see any, except that the PerlInterpreter is still experimental and I don't know if that's going to change. Do you know of any other options to call Perl from Java?
推荐答案
为什么不满意 java.util.regex.Pattern中
和 java.util你想使用Perl的正则表达式功能的.regex.Matcher
类? ; - )
Why are you not happy with java.util.regex.Pattern
and java.util.regex.Matcher
classes that you want to use Perl's regex capabilities? ;-)
这篇关于从java调用Perl,主要用于正则表达式匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!