http://qs321.pair.com?node_id=1162894


in reply to Dazed/Confused from previous posts on how to call Java method from Perl

A slightly different, very generic way of doing it:

Define and implement an interface in both languages, communicate using the interface. You probably want to use a client-server model, but peer-to-peer may also work.

For communication, Unix domain sockets and TCP/IP sockets (usually via localhost) are quite easy to use from many languages. (Ab)using HTTP is also an option. To encode data, consider using JSON, it's lightweight and has encoders and decoders implemented in about 60 languages. YAML or XML may also be useful. There are also at least two spec for JSON-based Remote Procedure Calls.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)