How can I embed a Perl interpreter in my C# program using Mono on Linux?

非 Y 不嫁゛ 提交于 2019-12-07 18:56:47

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!