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:- MyFormat is obviously just a placeholder.
- I've chosen not to use the top namespace MyFormat directly, anticipating that if the format proves to be successful, other people will want to use it for their modules.
- In addition to the XS-based parser, a pure-perl MyFormat::Simple::Parser::PP may be developed later, and the main module could fall back to it if the XS module is not available for some reason.
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.