Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: (tye)Re: overload and XS

by kmacleod (Initiate)
on May 18, 2001 at 16:56 UTC ( #81479=note: print w/replies, xml ) Need Help??


in reply to (tye)Re: overload and XS
in thread overload and XS

This module is a bridge between C code and Perl code (similar to Inline), the 'value' above is a C pointer to the structure that is tied, that I want to be able to stringify. 'xml_attribute_stash' is the Perl wrapper package for that particular class, which has 'use overload' with '""' and 'fallback' specified.

I found that I needed to use SvAMAGIC_on to enable overload on that tied C-structure so that the wrapper would see it as overloaded, but 'fallback' still isn't enabled. I'm guessing there's deeper magic to turn on fallback, since the perl wrapper isn't.

Replies are listed 'Best First'.
(tye)Re2: overload and XS
by tye (Sage) on May 18, 2001 at 23:43 UTC

    What I am saying is: Move all of that code out of the C part of the module/XS. Have the C part just return the 'value' as an IV or UV in an orinary Perl scalar and do all of the hash creation, taking of references, tieing, overloading, and magic in Perl code.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-12-09 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?