in reply to Inline::C vs. XS vs. SWIG

Swig is very easy as long as your c code is broken into separate subroutines. You just add the subroutine descriptions to the .i file, and run it thru swig, then compile. Here is an example of controlling your cdrom tray with swig. cdrom with swig

If you do a search on perlmonks for cdrom, I have the same code as inline C. You can look at them for comparison.

The advantage to using swig is that it precompiles the c into a .so shared object file, thereby increasing speed. Inline c needs to compile the code at each calling of the script.

I havn't tried xs, it just seemed to much complexity for the task at hand.