http://www.perlmonks.org?node_id=1018810

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

I want to create a module that will provide a Perl interface to a specific file format. (The format itself is still under development at this point, that's why I don't write details here.)

I want to re-use the project's reference parser, written in C, to do the parsing for me, however, I want to keep the XS part in a sub-module. Specifically, if the main module, providing the user interface, will be called MyFormat::Simple, then I'd want to put the XS module that interfaces with the C parser in MyFormat::Simple::Parser::XS.

Three notes here:

Now my question is, how to set about to create all this? More specifically, which module creation framework to use, and how exactly?

Should I run h2xs twice, separately, for the two modules, once with -X for the main module that doesn't need XS, and once with -x for the XS module?

Or should I use some other supposedly better and more modern tool, like Dist::Zilla for the non-XS module?

Or should I create just one module skeleton, and work inside it on the submodule as well?

I appreciate any help.

  • Comment on Creating a new module with an XS submodule

Replies are listed 'Best First'.
Re: Creating a new module with an XS submodule
by Anonymous Monk on Feb 15, 2013 at 17:25 UTC

      I know about Inline::C, I've used it in the past, but I don't see how it could help me here. I was under the impression that it is primarily for embedding C code in perl scripts quickly and easily, whereas I want to create a proper module that I eventually want to release on CPAN.

      My question was more about module organization, anyway.

      none, they don't really help

      Would you care to elaborate on that?