Perl / CPAN how to distribute a script, not a module

I just published my first perl program, unifdef + (code :: unifdefplus, v0.5.3), but I'm not sure if I did this correctly. The program is divided into two parts - script (script / unifdef + .pl) and module (lib / unifdefplus.pm). The script is basically a wrapper for a module. This should act like a command line utility (actually this is what I wanted to publish).

In the README file, I included the script documents, not the module. CPAN seems to be using the version from the module, not the script (which is now undefined).

So my questions are: if I want this to be indexed as a script, not a module, do I need to do something differently? In addition, I take it, I have to write some documentation for the module, and in this case, I assume that it should be a README file in the lib directory?

Again, I apologize, but this is the first time I have done this, and I want to make sure that I did it right.

+6
source share
1 answer

From the beginning, please read About module names from PAUSE administrators. If you still have questions or are still unsure, refer to modules <at> perl.org .

The easiest way is to use the name in the App:: namespace, for example App::MyMod .

As a rule, I saved the script and module documentation in their separate files, but at the top of the module documentation I explicitly referred to the script documentation and indicated that most users would want to read this for normal use.

To create a README from the script documentation:

 pod2readme bin/my_script 

Similarly, if you change your mind and want README refer to the module:

 pod2readme lib/App/MyMod.pm 

Assuming you are using ExtUtils :: MakeMaker for your builds, you can verify that the script is installed by adding the directive:

 EXE_FILES => [ 'bin/my_script' ], 

Unless, of course, your script is in the top level bin your distribution. Other build systems have similar directives.

+6
source

Source: https://habr.com/ru/post/1015301/