The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.


XS::Tutorial - documentation with examples for learning Perl XS


XS Mechanics by Steven W. McDougall

A clear introduction to XS programming.

Extending and Embedding Perl (Manning) by Simon Cozens and Tim Jenness

A thorough introduction, with many examples. Outdated in parts (mostly data structures) but still an excellent reference.


  • perlxs: syntax of xsubs

  • perlapi : C macros used to interact with Perl data structures (and the interpreter)

  • perlguts: Perl data structures

  • perlxstypemap: typemap syntax (translating C types into Perl)

  • perlcall: how to call Perl subroutines and methods from XS

  • perlxstut: another XS tutorial


The documentation explains all of the options in Makefile.PL. Useful if you need to pass additional flags or options to the C compiler.


A header file, needed for compatibility across Perl versions. See Devel::PPPort.

Perl source code

if you can’t find an answer in documentation, grep the source.