in reply to Take over STDOUT / STDERR for Perl embedded in C application
First thought is to do "wrap" the text to be evaluated like this:
Then you should be able to access the scalars in the Hidden package.string s = "local *STDOUT; local *STDERR; open(STDOUT, \$Hidden::stdou +t) or die \"Can't redirect STDOUT: $!\"; open (STDERR, \$Hidden::stde +rr) or die \"Can't redirect STDERR: $!\";\n" + code_from_user;
But, then again, I've never done any sort of XS code to interface with perl. I've thought about it, but I've never actually done it.
|
|---|