Need to learn C, best books?

Dirk Koopman djk at
Wed Oct 24 15:00:35 BST 2007

Andy Armstrong wrote:
> Once you have your head properly around that kind of thing interfacing 
> with Perl is pretty simple. Investigate Inline::C - it's easier than 
> plain old XS.

You are entitled to your opinion, of course, but mine is the exact 
opposite. Inline::C is a pain, it is unmaintained and extremely limited 
in what you can actually do, plus it relies on there being a working 
development environment on each computer where the module is used. Also 
h2xs is designed to help one generate XS based CPAN style modules and 
this doesn't fit at all well with Inline::C's assumptions.

XS is merely not very well documented for the non-XS aware C programmer. 
And no, I would not recommend any of the books on XS - at all. Sorry.

I found that the only way, that worked for me, into XS was to look at 
some simple XS, and print out all the perldocs on XS and perl internals, 
then compare and contrast. You should also learn to recognise 'old' XS 
(which is not really XS at all but the "perl internal speak" that XS is 
designed to hide and then look for the modern XS equivalent that you 
should use).

After that, it was quite simple really. There is a lack of useful 
information as to how to create arrays and, especially, hashes. But even 
  these are straightforward enough once one has mastered reference 
counting and what that all means.


More information about the mailing list