Help with Embedding and Arrays of Arrays? 
Author Message
 Help with Embedding and Arrays of Arrays?

Greetings

I'm trying create a simple Perl embedding class for
a C++/Perl application a friend of mine is writing.
One of the data structures I think he is using is
an array of arrays (a 2D array).  I know how to
dereference an individual element in Perl code, but
I'm having trouble doing it in C++ code using the
Perl api.  So, if anybody out there is really good
with the Perl C api, maybe you could help me with
this vexing issue.

Right now, I'm using get_av() to get an AV* from the
Perl variable name.  That works fine. Then, I'm using
av_fetch() to retrieve an element from the array,
which should be a reference to another array (e.g.
the first row).  So, I take the SV* that I got from
av_fetch(), and convert it to a reference RV* with
SvRV().  Then, ... ... I'm stumped.  I cannot find a
way to convert the RV* reference to an array into an
AV* that I can use.

Thanks for any help or advice you can give...

...nz



Thu, 10 Jun 2004 05:15:19 GMT  
 Help with Embedding and Arrays of Arrays?
I asked for help on this topic last week...

Quote:

> Right now, I'm using get_av() to get an AV* from the
> Perl variable name.  That works fine. Then, I'm using
> av_fetch() to retrieve an element from the array,
> which should be a reference to another array (e.g.
> the first row).  So, I take the SV* that I got from
> av_fetch(), and convert it to a reference RV* with
> SvRV().  Then, ... ... I'm stumped.  I cannot find a
> way to convert the RV* reference to an array into an
> AV* that I can use.

...and now I feel stupid.  It turns out that all you
need to do is cast it.  Oh well.  Hope you all got
a chuckle out of my ignorance.

...nz



Tue, 15 Jun 2004 09:04:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help with Embedding and Arrays of Arrays?

2. URGENT: Hash in Hash, Array in Array, Array in Hash, Hash in Array

3. Variable length array of arrays into tree structure - help

4. help with arrays of arrays

5. Help with Arrays of Arrays

6. help w split and array of array plse

7. Help with sort routine and array of associative arrays

8. Help on Arrays of Associative Arrays

9. Please help with associative arrays of arrays!

10. Help me again : with array of hashes of array

11. Beginner help with Array of Multiple arrays

12. Help with Array of Assoc. Arrays

 

 
Powered by phpBB® Forum Software