The easy approach is to install and use Inline::C to generate the XS scaffolding for your code. After that, you throw away Inline::C and only use its output.
If you don't know how to install Inline::C, the easy approach is outlined in the following steps:
- Install local::lib (because you don't want to pollute the system Perl)
- Set your environment variables like local::lib proposes
- Download cpanm from http://cpanmin.us
- Run the following command:
cpanm Inline::C
You now have Inline::C and its prerequisites installed in a local directory and can use Inline::C to generate much of the XS code for you.