test.c
:
int sum(int a, int b)
{
return (a+b);
}
test.pl
:
# how do I call sum here?
答案 0 :(得分:14)
use Inline C => <<'__END_OF_C__';
int sum(int a, int b)
{
return (a+b);
}
__END_OF_C__
say sum($x,$y);
答案 1 :(得分:0)
您需要XS
。它非常复杂,所以最好查看它的官方手册和教程页面: