ajaffres has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys!

Would anyone know how to get the real address of a variable ( especially a string) in Perl. Ta!

Actually I need the address of a string (binary) to be passed to a C function of this type (void MyFunction(unsigned char *input, unsigned char *output) without giving the length (the length is dealt within the C function. My function just need the address to work fine.

Arnaud

Replies are listed 'Best First'.
Re: the address of a string
by holli (Abbot) on May 19, 2005 at 10:13 UTC
Re: the address of a string
by salva (Canon) on May 19, 2005 at 10:28 UTC

    what you are looking for is SvPV() or SvPV_nolen(), look for the docs on perlapi... and read also perlxs, perlxstut and perlguts.