Apologies for typo in the code sample. I tried prefixing "our", but that didnt change the result.
As almut said, I am using a cloned interpreter and the perl sub/callback is executed in the cloned interpreter context. So, is the problem in how I'm cloning it? Or does cloning by definition mean, I cannot "share". Here is a post describing how I've done the embedding.
One "crude" way I can think of is to implement a "shared memory" API on C side to save/retrieve data between the subs and main. Perhaps CPAN has modules like this already..but I'm really hoping there is a more "natural" solution.
http://markmail.org/thread/cjbhybjfikuirvud
http://markmail.org/thread/inetppjegt5iecl5
In reply to Re^3: Extending & Embedding Perl simultaneously: How to share a scalar between perl callback sub and main body?
by perlmonk1729
in thread Extending & Embedding Perl simultaneously: How to share a scalar between perl callback sub and main body?
by perlmonk1729
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |