test.c
:
int sum(int a, int b)
{
return (a+b);
}
test.pl
:
# how do I call sum here?
use Inline C => <<'__END_OF_C__';
int sum(int a, int b)
{
return (a+b);
}
__END_OF_C__
say sum($x,$y);
你需要XS
. 它涉及到很多,所以最好看一下官方手册和教程页面: