views:

47

answers:

1

I am embeding perl interpreter in my C code (what fun!).

I need to dynamically load perl extensions (an extension that extends perl, written in C). When I run a perl script (using my embeded perl interpreter) that needs to use that extension, it will work!

+6  A: 

Make sure to have pass an xs_init function to perl_parse that will provide DynaLoader::boot_DynaLoader for you. You can write those automatically with ExtUtils::Embed.

With that, all you need to do is, for example, eval some code that will load an extension written in C.

"Using Perl modules, which themselves use C libraries, from your C program" in perlembed explains this in detail.

rafl