[Israel.pm] Calling perl from C

Gaal Yahas gaal at forum2.org
Mon Oct 11 11:34:23 PDT 2004


[cc:ing back to the list]

On Mon, Oct 11, 2004 at 07:12:43PM +0200, Yuval Marsiano wrote:
> > > Could someone tell me what is the best way call from C, a perl
> > > subroutine, which is returning to the C module array of strings?
> 
> > The perlembed manpage has working examples for this kind of thing.
> 
> I cant find a perl func which return list of strings to C module

Look at the example code after the first mention of the word "array" in
perlembed. You'll see that you get an AV* from get_av in matches(), and
then in main() use "SvPV(*av_fetch(match_list, i, FALSE),n_a)" to access
each element.

-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list