use strict; use warnings; use Inline C => <<'END_OF_C'; void foo() { char *s = (char *)malloc(100); sprintf(s, "%s", "hello there"); printf("'%s'\n", s); free(s); } END_OF_C foo(); __END__