in reply to Call C functions from Perl

Getting Started with Inline::C should help. It has some good examples of how to call an external library function.