You have to write an interface between the two languages, and for that there are two tipical ways:
- Using a socket: both languages run in their own process space and some kind of RPC is used to call one into the other through the socket. You have to serialize the data crossing the interface and deserialize at the other side while remaping it to the other language types. Using something standard as XML or YAML for the serialization is an option, but it has a big overhead.
- Using XS (or Inline, SWIG, etc.): both languages run in the same process and the data is converted between the two languages using some C code. You have to provide a set of functions on every side of the interface to call the other language (for instance, on the language calling perl: perl_call_sub, perl_call_method, perl_eval). That solution is usually much faster, but you have to program it in C/XS.
If you tell us what is your target language, we would be able to give more specific indications about how it can be done.