Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ethan (3163)

ethan
  reversethis-{ed. ... rap.nov.olissat}

Being a 25-year old chap living in the western-most town of Germany. Stuying communication and information science and being a huge fan of XS-related things.

Journal of ethan (3163)

Friday January 16, 2004
04:55 AM

Reading docs helps

[ #16857 ]

This morning I added the overloading stuff for the Device::CDROM::Addr objects. I first poked around in the perl source to figure out how to do that until I declared this approach fruitless. All I got were segfaults.

Then - more by accident than on purpose - I stumbled over the OVERLOAD keyword in perlxs. I was delighted to see that there is in fact a defined XS interface to overloading. Nice.

However, xsubpp apparently gets confused when you have several packages in one .xs file. It registered my overload handler into the wrong package (Device::Addr::Format which happens to be the last package in the file). This left my module in an uncompilable state.

So I did a google-search for the OVERLOAD keyword, found nothing. After that, I used google to scan perl5.porters for me and found a short reference to OVERLOAD by John Peacock. This name always triggers Version in my mind so I looked it up on the CPAN and indeed did find a stupendously easy solution to my problem in version.xs.

I'd be a rich chap by now if someone paid me half a Euro (or whatever) each time I solved a problem by looking at other people's code.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.