SV *g_rec = 0; int setCallback( SV* rec ) { g_rec = rec; SvREFCNT_inc( g_rec ); return 0; } void callback() { // call_sv( g_rec, 0); }