On Fri, Nov 19, 2004 at 01:39:29AM -0500, Eric Garland wrote:
> I have a piece of code in XS land that reads data from an
> external source and populates a scalar that's passed
> in to it (ala sysread).  It doesn't seem to work if I
> pass a shared variable in to it though.  Is there any
> documentation that talks about how to work with shared
> scalars from XS?
> ...
>     CODE:
>         sv_setpvn( pValue, "", 0);
>         value = (char *) SvGROW(pValue, pReadLength);
>       
>               **stuf you don't care about that writes to the buffer
>               **referred to by "value" and returns a length in pReadLength
> 
>         SvCUR_set(pValue, pReadLength);

I expect adding:

     OUTPUT:
       pValue

at the end will fix this, or an explicit call to SvSETMAGIC(pValue).

-- 
Tony Cook

Reply via email to