in reply to Re^3: perl c++ perlembed question
in thread perl c++ perlembed question

hm but that also does not call a function from the c++ code from within the power.pl script?

i wanted
c++ with a func bla() and an embedded perl interpreter
this c++ programm is executed and running
it embeds a perl interpreter that runs foo.pl invoked with some param
foo.pl runs and executes bla() from the c++ script and gets some return value from the bla() func
foo.pl returns something to the c++ program
...

Replies are listed 'Best First'.
Re^5: perl c++ perlembed question
by syphilis (Archbishop) on Jun 27, 2009 at 23:53 UTC
    that also does not call a function from the c++ code from within the power.pl script

    That's correct - sub expo is simply being passed values that come from the C code (subs foo and bar).

    foo.pl runs and executes bla() from the c++ script and gets some return value from the bla() func

    That's the tricky bit ... well, "impossible" rather than "tricky", one suspects. I don't know how foo.pl could run bla() directly.

    I also don't know why foo.pl would *need* to run bla() directly, given that bla()'s return value could be passed to foo.pl as an argument (as per the power.pl example already supplied). If the need to have foo.pl call bla() is a non-negotiable requirement, then I can't help at all with that aspect.
    UPDATE: I now think I *can* envisage circumstances where it would be nice if foo.pl could call bla() directly - but I still have no idea how that could be achieved.

    Thanks for an interesting question, btw. (I learned something in trying to answer it.)

    Cheers,
    Rob