in reply to Re: Answer: how do i push an array into the perl stack in C prog before calling perl_call_pv
in thread how do i push an array into the perl stack in C prog before calling perl_call_pv
To emulate my_function("string1",@arr1,@arr2,"string2",@arr3) you just need to XPUSH the string, then XPUSH each of the elements of @arr1 (you don't need to build an array), then XPUSH each of the elements of @arr2, then XPUSH the next string, then XPUSH each of the elemnts of @arr3.
That is, in this code:
the last two lines are the same (unless my_function has a prototype). - tye (but my friends call me "Tye")my @arr1= qw(A few things); my @arr2= qw(Two vals); my @arr3= (1,2,3); my_function("string1",@arr1,@arr2,"string2",@arr3); my_function(qw(string1 A few things Two vals string2),1,2,3);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Answer: how do i push an array into the perl stack in C prog before calling perl_call_pv
by ragu (Initiate) on May 08, 2001 at 12:30 UTC | |
by tye (Sage) on May 08, 2001 at 18:16 UTC | |
by Anonymous Monk on May 09, 2001 at 10:36 UTC | |
by tye (Sage) on May 09, 2001 at 11:10 UTC | |
by Anonymous Monk on May 10, 2001 at 09:13 UTC |