in reply to XS and preserving magic

You grep the perl source and grab a magic type of your very own that doesn't get stomped on in the unpleasant ways that '~' magic does. But you can't have chr(185) because I'm already using that for Pixie::Info.

If you want to see how it's done, grab Pixie and take a look at Info.xs

Replies are listed 'Best First'.
Re: Re: XS and preserving magic
by shotgunefx (Parson) on Jan 19, 2003 at 18:04 UTC
    Thanks for the suggestion. I'll check it out. I ended up using '~' because in 5.8 it doesn't trample it so stole the sv_magicext() function and put it into the xs file and so far seems to work fine with 5.6.1

    -Lee

    "To be civilized is to deny one's nature."
      We tried to use '~' within Pixie, but for a very good reason that I now can't remember, we ended up having to introduce our own magic type.
        The thing that would concern me is that if the module is generally useful, that an implementation "collision" would occur. I can't imagine how hard it would be to track that bug down. Before this little project I would never ever consider that possibility. If you remember the reason, please do tell. Hopefully I can avoid it though.

        -Lee

        "To be civilized is to deny one's nature."