in reply to Re^7: Inline CPP
in thread Inline CPP

Thanks Rob, It helped. I did the option you wrote (with one level referencing) and it worked.
void add_nir(int x, int y, AV * perlList) { SV* perlItem=newSViv(2); av_push(perlList, perlItem); }
I understand that I shouldn't have initialized the AV* inside the cpp code, but only outside in the perl code as you did. Thanks again!

Replies are listed 'Best First'.
Re^9: Inline CPP
by syphilis (Archbishop) on Jun 04, 2008 at 03:08 UTC
    As I mentioned in my previous post, that rendition of add_nir() won't work with perl 5.10. If that's a concern, then just switch to the other rendition provided in that last post of mine.

    In the meantime, I've gone digging into the Inline::CPP source, found the problem, and made out a bug report about the issue (which includes a fix). That bug report and fix can be found at http://rt.cpan.org//Ticket/Display.html?id=36421 . As I've mentioned there, I really don't know whether the fix I've provided is the correct one.

    Cheers,
    Rob