use warnings; use strict; use Inline C => Config => BUILD_NOISY => 1; use Inline C =><<'EOC'; void call_Adder(int a, int b) { dSP; int count; ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSViv(a))); XPUSHs(sv_2mortal(newSViv(b))); PUTBACK; count = call_pv("Adder", G_SCALAR); SPAGAIN; if (count != 1) croak("Big trouble\n"); printf ("The sum of %d and %d is %d\n", a, b, POPi); PUTBACK; FREETMPS; LEAVE; } EOC call_Adder(17, 16); sub Adder { my($a, $b) = @_; $a + $b; }