Good idea, I will simply store the pointer in integer and provide a method to transform it to string. After some though I realized that it is impossible to store the string directly because the packet may contain NULL characters and the sv_setpv will fail as a result.
Daniel Shane > -----Original Message----- > From: Vivek Dasmohapatra [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 21, 2002 2:46 PM > To: Daniel Shane > Cc: [EMAIL PROTECTED] > Subject: RE: How to malloc a char ** from C to Perl (btw, $! > now works, > t hank > > > On Mon, 21 Jan 2002, Daniel Shane wrote: > > > I made a more simple version by storing the pointer in an > integer. But it is > > no longer possible to do print $packet... (it just prints > the pointer...) > > Have you considered blessing the SV thus created and either > providing an XS > method that returns a string SV copied from the pointer > (eg: $xs_thing->data()), or even TIEing to a package which > does this for > you when you read the value in perl? > > -- > Vivek >
