问题
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.
来源:https://stackoverflow.com/questions/1119923/how-can-i-embed-a-perl-interpreter-in-my-c-sharp-program-using-mono-on-linux