http://www.perlmonks.org?node_id=1224753


in reply to Re^2: MAC Perl EXTERN.H Make Issues
in thread MAC Perl EXTERN.H Make Issues

"Next on the list is writing some local modules with C library bindings"

I've done this quite a few times.

My WiringPi::API might be a reasonable example for you to have a look at. The API.xs file contains a few custom C functions that are provided to Perl, as well as the list of the majority of functions that are accessed from the shared wiringPi library itself.

The API.pm Perl module file loads the XS file, and provides direct access to the C functions directly, and optionally presents the equivalent Perl wrappers (the software can be used in Object Oriented or functional style).

The Makefile.PL file, specifically the LIBS and INC directives show how to link in the shared libraries, and how to include your required files respectively.