in reply to Re: How to extract/set RV information?
in thread How to extract/set RV information?

As an example, after running some perl code and retrieving the returned SV off the stack, I can extract a long value from it by running:

long value = SvIVx( thesv );

If I want to pass the long value back to my perl program, I can put it inside an SV by running the following:

SV* newsv = newSViv(long_in);

Same goes for double and string values. It is relativelly easy to extract them form the SV, pass it along to other programs, and then put it back into an SV.

No idea how to do the same for a reference, RV.

Greg

Replies are listed 'Best First'.
Re^3: How to extract/set RV information?
by Marshall (Canon) on Jun 09, 2009 at 14:35 UTC
    I don't have an answer right now, but I do have a recommendation: buy "Advanced Perl Programming" by S. Srinivasan. The discussion of Perl Value Types starts on page 328. HV's are discussed starting on page 337. Pages 328-350 are "not particularly easy", but are understandable with C knowledge.