简体   繁体   English

如何在Linux上使用Mono将Perl解释器嵌入C#程序中?

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

Does anyone know if it's possible to call a Perl sub from Mono in C#? 有谁知道是否可以在C#中从Mono调用Perl子程序? This is on a Linux machine. 这是在Linux机器上。

Maybe DllImport ? 也许DllImport We want to avoid loading perl every time if possible, as well. 我们也希望尽可能避免每次都加载perl。

PerlMonks上的该线程可能会有所帮助。

Interop works fine with Mono under Linux to call C-Code. Interop与Linux下的Mono可以很好地调用C代码。 Thus I would consider that you look at perlembed . 因此,我认为您会感到困惑 Instead of a C-program you need to create a shared C-library. 您需要创建一个共享的C库而不是C程序。 For Interop there are several good guides - a potential pitfall are sizes of datatypes, because you get really plaform/CPU dependent. 对于Interop,有一些很好的指南-潜在的陷阱是数据类型的大小,因为您实际上依赖于平台/ CPU。 Let me know if you need anywhere more detailed information. 让我知道您是否需要更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM