Nick Ing-Simmons wrote:

>Steve Hay <[EMAIL PROTECTED]> writes:
>  
>
>>Why is it that when I create an SV and assign magic to it in an XSUB, 
>>and then return the magical SV to Perl code, I find that the scalar in 
>>the Perl code no longer seems to have magic?
>>    
>>
>
>If you print something the FooFree() you will see what is happening.
>You return an SV.
>SV gets copied to $a - magic isn't copied 
>Your SV gets free-d
>$a is passed to your function.
>
I think "magic isn't copied" is the main thing there.  I hadn't realised 
that.  I think I'd also probably lost sight of the fact that the SV gets 
copied when returning from a sub.  I was confusing what happens with 
what happens when an SV is passed _to_ a sub.

It all makes much more sense now :)

- Steve



------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only.  If you have received this 
message in error or there are any problems, please notify the sender immediately.  The 
unauthorized use, disclosure, copying or alteration of this message is strictly 
forbidden.  Note that any views or opinions presented in this email are solely those 
of the author and do not necessarily represent those of Radan Computational Ltd.  The 
recipient(s) of this message should check it and any attached files for viruses: Radan 
Computational will accept no liability for any damage caused by any virus transmitted 
by this email.

Reply via email to