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);
In reply to Re: Re: Answer: how do i push an array into the perl stack in C prog before calling perl_call_pv
by tye
in thread how do i push an array into the perl stack in C prog before calling perl_call_pv
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |