in reply to Calling perl from java
It can be tricky, but it can be done.
HOWEVER Given that you've implied that most of the need to call perl from java lies in Perl regexe's you should be aware that as of Java 1.4.1, Java includes a 'Pattern' class whose syntax closely parallels the Perl regex syntax with some differences(ref Pattern Docs)
It pains me to recommend this, but you would probably do well to examine how hard it would be to convert your existing perl regexes to Java Patterns if Java 1.4.1 is in use. If the patterns are relatively simple and you get the hang of Java patterns quickly enough, then you should probably go with converting your perl regexes to Java Patterns. Two days of kicking the tires on trying Java patterns to see if it would work would probably be time very well spent. If you're using regex syntaxes that are not well supported in Java patterns, look again at the JNI solution.
Also consider that if you move to a different platform, you're going to have to make sure that your JNI library works on that other platform as well.
Keep also in mind the people who follow you on this project. If you manage to keep it all Java, you've simplified their lives considerably. If you go the JNI route, they'll have to support Java, Perl, C/C++, Makefiles and JNI's own collection of issues.
Step back, and examine the pros and cons of both approaches very carefully.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Calling perl from java
by hardburn (Abbot) on Oct 15, 2003 at 20:25 UTC | |
by revdiablo (Prior) on Oct 15, 2003 at 23:52 UTC |