in reply to Re: Re: 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

That is the point: It wouldn't. I suggest you read more about Perl if you think that it would. For example, if you have Perl installed, type "perldoc perlsub" for lots of information about Perl subroutines and how to call them.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re3: Answer: how do i push an array into the perl stack in C prog before calling perl_call_pv

Replies are listed 'Best First'.
Re: (tye)Re3: Answer: how do i push an array into the perl stack in C prog before calling perl_call_pv
by Anonymous Monk on May 09, 2001 at 10:36 UTC
    hi,
    sorry for my persistence.i'm kind of stuck because of this and i need to find a solution. though i am not a perl expert,i do know about basics of todays trend of languages. using reference mechanism i can do this in perl(below).Is it possible to pass this reference if i were to call this sub 'call()' from a C prog after XPUSH'ing the arguments into the perl stack. please do reply.
    #begin #!/bin/perl @xyz=(abcdefghij,xyz,sdfakjsadfk); @abc=(123,345,567); &call("string1",\@xyz,\@abc,"string2"); sub call { $w=$_[0]; $x=$_[1]; $y=$_[2]; $z=$_[3]; foreach (@$x){ print "$_ "}; print "\n"; foreach ($w){ print "$_ "}; print "\n"; foreach (@$y){ print "$_ "}; print "\n"; foreach ($z){ print "$_ "}; print "\n"; } #end
    thank you
    ragu

    Edit by tye

      Which takes us back to what I said first: You can make a reference to the array and XPUSH that. See "perldoc perlguts" under the heading "References" for more information.

      Sorry, I don't know how to make a reference off the top of my head, but I doubt that it is terribly difficult.

              - tye (but my friends call me "Tye")
        got it .thanks a lot. ragu