How do I embed Perl code inside perl-xs module?

67 views Asked by At

I wrote a Perl module to create a binding for a shared library with h2xs. Simple and easy to do.

However, I would now like to include some Perl helper with this module. How do I go about doing this? I would assume it needs to go in the "blah.pm" file - but this file is generated by the build.

Is there an (easy) way to specify a body of code to be included in it?

1

There are 1 answers

0
Len Jaffe On BEST ANSWER

Put the helper code in a separate module e.g. Blah::Helper.pm. Use blah.pm from within Blah::Helper.pm