How can I embed a Perl interpreter in my C# progra

2019-05-23 20:44发布

问题:

Does anyone know if it's possible to call a Perl sub from Mono in C#? This is on a Linux machine.

Maybe DllImport? We want to avoid loading perl every time if possible, as well.

回答1:

Interop works fine with Mono under Linux to call C-Code. Thus I would consider that you look at perlembed. Instead of a C-program you need to create a shared C-library. For Interop there are several good guides - a potential pitfall are sizes of datatypes, because you get really plaform/CPU dependent. Let me know if you need anywhere more detailed information.



回答2:

This thread on PerlMonks might help.



标签: c# perl mono embed