in reply to XSUBs with variable input types
The Embedding and Extending Perl book handles this, and a lot more - I've found it very useful (I'm not much of a C programmer)