in reply to XS or SWIG

I've never personally used SWIG, but from what I hear it's a bit easier to pick up. The down side is that since it's targeted towards working with multiple languages you might not be able to do things in the most perly way. You also want to look at Inline and friends (specifically Inline::CPP).