XS (Perl)

[1] The following shows an XS module that exposes a function concat() to concatenate two strings (i.e., the equivalent of Perl’s .

The section that starts with MODULE = Demo::XSModule defines the Perl interface to this code using the actual XS macro language.

Note that, for building Perl interfaces to preexisting C libraries, the h2xs[further explanation needed] can automate much of the creation of the XS file itself.

Creation and maintenance of XS modules requires expertise with C itself as well as Perl’s extensive C API.

Also, new versions of Perl may break binary compatibility requiring XS modules to be recompiled.