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

2019-05-23 20:48发布

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.

标签: c# perl mono embed
2条回答
何必那么认真
2楼-- · 2019-05-23 21:28
爱情/是我丢掉的垃圾
3楼-- · 2019-05-23 21:34

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.

查看更多
登录 后发表回答