in reply to perl c++ perlembed question

Maybe you could try Inline::CPP.

Replies are listed 'Best First'.
Re^2: perl c++ perlembed question
by eth0nic (Initiate) on Jun 27, 2009 at 16:22 UTC
    how would inline::cpp help me with embedding perl in an c++ project AND THEN calling some functions that where declared BY THE SAME c++ CODE THAT embedded the perl script from WITHIN the running and embedded perl code?
      It doesn't matter which code embeds what. The only real difference between embedding perl in C and C in perl is that if you embed C code in perl you can use the standard perl interpreter to start everything, and otherwise you'll have to "manually" start the perl interpreter using a (short) bootstrap sequence in C.

      Once you've done that, you can call into C and C++ functions from perl and vice versa regardless of how the startup procedure was executed.

        and once more ... i dont want to just call some random XS wrapped funcs ... i want to call funcs that i declared in c++ BEFORE starting the perlembed stuff already ... they are in the memory ... i want to access them from the embdedded perl script ...
        this still does not answer my question about the "HOW" ... :-(

      You can look at the code produced by Inline::CPP to see how it calls CPP routines and how it compiles and links the code. In short, it is a way for you to generate your own examples that call your own code. But I agree that it will not produce an example of a C++ routine calling an embeded perl interpreter calling a C++ routine - sorry...