in reply to reinitializing embedded perl interpreter: undefined subrouting called during global destruction

I think you should show us the relevant parts of your code.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: reinitializing embedded perl interpreter: undefined subrouting called during global destruction

Replies are listed 'Best First'.
Re^2: reinitializing embedded perl interpreter: undefined subrouting called during global destruction
by kingkongrevenge (Scribe) on Mar 31, 2009 at 03:14 UTC
    The perl initialization and shut down are basically straight out of the perlembed man page.

    { const char *args[] = { "", "-ew", "0" }; const char** aargs PERL_UNUSED_DECL = args; static int arg_count = sizeof args / sizeof *args; PERL_SYS_INIT(&arg_count, const_cast<char***>(&aargs)); my_perl = perl_alloc(); perl_construct(my_perl); perl_parse(my_perl, xs_init, arg_count, const_cast<char**>(args), NULL +); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; } { perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); }

    The XS for the relevant module is in another comment in this thread. The code to load the module is vanilla:

    newXS("boot_Clock", functionPointerToEXTERN_C_boot_Clock, __FILE__); eval_pv("boot_Clock", true);