rsteinke has asked for the wisdom of the Perl Monks concerning the following question:

How do I build a Perl module which contains a mix of XSUB and Perl code? Do I need to specify some argument in the Makefile.PL so that the perl sources get installed as well as the .pm file which links to the compiled .xs code?

Replies are listed 'Best First'.
Re: Perl module with mixed code
by Elian (Parson) on Jun 14, 2002 at 19:53 UTC
    No. If you created the skeleton with h2xs, it'll all work out the way it should automatically.
      I was having a problem with that, but figured it out eventually. The Perl code was in a separate .pl file, and both that file an the .pm file were getting installed. The functions in the .pl file weren't getting found, naturally. Since the code in question was being used in the Makefile.PL (to get C compiler flags) as well as in the module, I ended up using do FILE to include it both places.