in reply to Empedding perl into C - how to pass complex structures to the perl ?

If you want it to be a hash you're going to have to construct a HV*, and possibly create a reference to it (RV) to pass to Perl. None of this is automatic for you, and if you do construct a hash don't expect the values to be updatable automatically. See perlguts for details on doing all of that.

Alternatively hide it in a class, and provide accessors to the data parts. See the XS Cookbook (CookbookA and CookbookB on CPAN) for details on how to do this.

  • Comment on Re: Empedding perl into C - how to pass complex structures to the perl ?

Replies are listed 'Best First'.
Re: Re: Empedding perl into C - how to pass complex structures to the perl ?
by Anonymous Monk on Feb 28, 2002 at 08:15 UTC
    Thnx you, I am seeing that this will not going to be ez for me : ). Any possibilities you could write a small example by constructing a HV*, creating the reference and then passing it to perl, please, please ?=) ..Im sure this is the solution I am looking out. -jari- jari@subspace.nu