Using C code with XS

I'm writing a perl daemon that will send many email messages. After looking at the SMTP modules availabe at CPAN, I've decided to take advantage of qmail to do all the SMTP sending and such. In order to send out the most messages possible I'm composing the message and making a system call to invoke qmail-queue to send it. This is not the right answer.

qmail is very fast, and I'd like to take advantage of it as much as possible, but the idea of executing a system call for each message isn't right. I'm thinking os using XS to interface with qmail-queue. I don't know anything about XS, Xsub, h2xs, etc, but I do know both Perl and C to a moderate level. I can't seem to find any good or robust documentation on XS so I can't determine if this is a stupid idea or not.

Can any of you tell me where I can find good documentation on XS, or whether the idea of taking a full program into a perl module via XS is crazy?

Thanks,

Terry

In reply to Using C code in Perl by terry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.