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
It would have to be a very special case indeed where executing Perl from Java to process a regular expression yields better performance. Regardless of whether Perl can process individual regular expressions faster than Java or not, there is an overhead to starting Perl up from Java, as well as a Thread overhead in Java to correctly manage a forked process.
Most likely, you will get better performance by processing your regular expressions directly in Java, unless you have very large data to query against which may serve to mitigate the startup costs of invoking a separate process.
Recommended steps:
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? ;-)