SV mysv = newSVpv(""); SvGROW(mysv, 1024); // preallocate 1024 bytes as buffer for the response sv_setpv("Hello World\0"); some_systemcall_with_the_message_buffer( SvPV(mysv), 1024); // writes the response into mysv and expects 1024 bytes to be writable