use strict; use warnings; use Inline C => Config => USING => 'ParseRegExp', BUILD_NOISY => 1, ; use Inline C => <<'EOC'; #include void *thread(void *arg) { char *msg = (char*)arg; printf("thread: %s\n", msg); free(msg); return NULL; } void test_thread(char *msg) { char *thread_arg = malloc((strlen(msg)+1)*sizeof(char)); strcpy(thread_arg, msg); pthread_t tid; pthread_create(&tid, NULL, thread, (void*)thread_arg); void *rv; pthread_join(tid, &rv); } EOC test_thread("Just another XS hacker");