use Inline C; $var = "something"; somefunc($var); __END__ __C__ somefunc(char* str){ . . return something; }