There's also this tutorial:
perlxstut
It's been quite a while ago,
so I'm not so sure about my solution with XS.
But I still remember, first this XS stuff really confused me.
But after getting an idea about the mechanisms,
with the help of (I believe) the linked tutorial,
it showed up quite straightforward and useful.
Just don't give up too quick, it pays out.
Best wishes, Michael