FREETMPS is cleaning up any temporary variables/values, which includes the return values of the Perl subroutine, so you have to copy your out_string in case you need it beyond FREETMPS. (Put the printf... statement immediately after out_string = POPp; and you'll see that things are working fine.)
BTW, POPp is deprecated — use POPpx instead, which also gives you the length of the string.
In reply to Re: embedding perl in c?
by almut
in thread embedding perl in c?
by jrs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |