#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" PerlInterpreter* my_perl; char* perl_lib_path = "/some/path/test.pm"; MODULE = TestModule PACKAGE = TestModule void upd_init(SV* perl_object) CODE: char *argv[] = {"", perl_lib_path}; my_perl = perl_alloc(); perl_construct( my_perl ); perl_parse(my_perl, NULL, 2, argv, (char **)NULL); perl_run(my_perl); dSP; ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(perl_object); PUTBACK; call_pv("test::init", G_DISCARD); FREETMPS; LEAVE; void upd_deinit() CODE: perl_destruct(my_perl); perl_free(my_perl); #### #!/usr/bin/env perl use strict; use PerlTestModule; my $ptm = new PerlTestModule(); TestLogger::upd_init($ptm);