If I understand correctly what you want, I see two possible ways, both of which are cool if they immediately work for you and very, very ugly if they don't:
- Use Inline::Java. This gives you a nice and convenient bridge between Perl and Java and allows you to pass data between them. I don't know if it can magically convert complex datastructures, but that should be a minor problem as long as all structure you have is arrays and hashes.
- Use a webservice to talk from Java with Perl. This means setting up your Perl code to be a SOAP server and then accessing it from Java via some webservice API.
If neither of the two ways works for you, I recommend communicating through a database or the filesystem - both languages have enough facilities to conveniently access the shared resource. Of course, then you will have to write your own code to serialize and deserialize the data, but maybe you can hack a storage for Java hibernate together which nicely deserializes in Perl.
| [reply] [d/l] |
For the one way round, see JNI (a Perl encapsulation of the Java Native Interface) and PBJ::JNI (full access to and from Java virtual machine from Perl). As for the other way round - calling perl from within Java - you might have a look at Jakarta ORO, they've done something with perl regexes. I don't know how they implemented it, wether they us perllib etc., since I'm no Java programmer. But maybe it's a starting point.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] |
| [reply] |