Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Pass a Perl aref to C, work on it, and get it back as a Perl array

by stevieb (Canon)
on Jan 27, 2017 at 17:51 UTC ( [id://1180485]=note: print w/replies, xml ) Need Help??


in reply to Pass a Perl aref to C, work on it, and get it back as a Perl array

I want to clarify my reasoning behind this. In Perl, I needed to pass in an unsigned char * to a C function (hence the aref, I just haven't changed it to use pack() or the like yet).

Then, I needed to get the return from that C function (a modified version of the unsigned char *), and return it as something that the Perl caller would be able to use (a list).

I do not know enough about the whole process to understand whether there's a simpler or more elegant way to do what I needed to do, and based on my (first couple of passes at) reading perlxs, perlapi, perlguts and Inline::C, that's what I came up with.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found