Tag Archives: C

在windows平台下在C语言中调用perl脚本

OS: Windows XP SP2 Complier:Microsoft Visual Studio C++ 2005

1. 下载并安装ActivePerl-5.8.8.819-MSWin32-x86-267479.msi安装包。 2. 用cpan安装ExtUtils::Embed模块. 3. 从cpan下载MExtUtils::Embed安装包,从中提取genmake脚本。 4. 安装ActivePerl 5.10. 5. 将系统中path环境变量中关于ActivePerl 5.10的环境变量去掉。 6. 编写调用perl脚本的c程序t.c。 7. perl genmake t.c 8. 将Makefile中的路径替换成ActivePerl 5.10的路径。 9. nmake 10. 将Config.pm, lib.pm, strict.pm复制到脚本所在目录。 11. 编写测试脚本。

t.pl: use strict; use lib ‘c:\perl510\lib’; use lib ‘c:\perl510\site\lib’;

use Digest::MD5 qw(md5 md5_hex md5_base64); my $digest = md5_base64(’12345′); print $digest; print … Continue reading

Posted in Perl | Tagged , , | Leave a comment

Ubuntu Linux 中,编嵌入lua5.1 的c程序。

程序 a.c

#include #include #include #include #include

int main (void) { char buff[256]; int error; lua_State *L = lua_open(); /* opens Lua */ luaL_openlibs(L); … Continue reading

Posted in Linux | Tagged , | Leave a comment

用C语言写Perl过程

http://search.cpan.org/~sisyphus/Inline-0.45/C/C.pod (new) http://search.cpan.org/~jtobey/C-DynaLib-0.55/DynaLib.pm

DynaLoader 模块

Posted in Perl | Tagged , | Leave a comment