First, you need a working C / C++ compiler (preferably the same compiler that was used to build your perl binary).
Then, if your header files are really simple, you might try h2xs to automatically convert header routines to XS code. h2xs is part of your standard perl install. XS code is a sort of C dialect with extra macros and syntactic sugar in which you can specify the calling conventions for subroutines than can then be called from perl.
Usually, though, you will need to write the XS code by hand. Take a look at the following manpages: perlapi perlxs, perlintern, perlguts, perlcall and perlembed.
Also useful are the "Advanced Perl Programming" and "Extending and Embedding Perl" books, and PerlGuts Illustrated.
Oh, and before I forget - you might want to take a look at Inline::C and its relatives. They can make it a lot easier to start experimenting with C / XS / Perl programming
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.