我怎么可以嵌入一个Perl解释器在Linux上使用单声道我的C#程序? [英] How can I embed a Perl interpreter in my C# program using Mono on Linux?
问题描述
有谁知道是否有可能从单在C#中调用一个Perl子?这是一个Linux机器上。
Does anyone know if it's possible to call a Perl sub from Mono in C#? This is on a Linux machine.
也许的DllImport
?我们希望避免加载的Perl如果可能的话每一次,也是如此。
Maybe DllImport
? We want to avoid loading perl every time if possible, as well.
推荐答案
互操作工作正常使用Mono在Linux下称C-码。
这样我会考虑你看看 perlembed 。
相反,你需要创建一个共享的C库的C程序。
。对于互有几个不错的导游 - 一个潜在的缺陷是数据类型的大小,因为你得到真正者平台/ CPU依赖性。
让我知道如果你需要的任何地方更详细的信息。
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.
这篇关于我怎么可以嵌入一个Perl解释器在Linux上使用单声道我的C#程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!