Howdy folks, Is there a recommended/safe/sane way to store a C function pointer in an SV? (Attached is Example.tar.gz which contains a module with the full code for example) This works (sample from Example.xs): SV * store_func_in_sv(void *addr) { return newSViv( (IV)addr ); } void call_func_from_sv(SV *sv) { void (*func)() = (void *)SvIV(sv); func(); } void func() { warn("Called!\n"); } MODULE = Example PACKAGE = Example void test() CODE: SV *ptr = store_func_in_sv(func); call_func_from_sv(ptr); But I'm not sure that's portable or safe. Thanks, -- Matthew Horsfall (alh)Thread Next