Question

I was wondering is there is any way to interact with Perl 5 code automatically, without creating explicit APIs and publishing it over some protocol. I don't want to limit this question to any specific ways of achieving that - I'm looking for any ideas.

Ruby can be accessed from JVM-based languages via JRuby for example; natively compiled languages are usually accessible via native shared libs / standard calling convention for that platform; others can have the interface autogenerated from code... What are the options for Perl?

Was it helpful?

Solution

As one option, you can embed a Perl interpreter, as shown here or here or here

OTHER TIPS

There is library for embedding Perl into your program (see perlembed.pod) that is compiled automatically - any language can use it, pyperl for Python, PEAR "Perl" extension for PHP, several attempts on using Perl 5 from Perl 6, several attempts to run Perl from JVM (all not finished), Perl.NET.

Also you can go other way, embed program in other language in Perl and just call Perl subs from program in other language. Main Perl program would consist just of calling your program in other language. There is big number of CPAN modules that integrate other languages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top