PerlInterpreter* my_perl = pthread_getspecific(PL_thr_key); #### PERL_SET_CONTEXT(some_perl);