Where to place non-essential .pl files in a distribution kit?

I would like to add some additional .pl files to my CPAN module. These files are not essential for using the module, but provide useful functionality / glue when the module is used in some general frameworks and applications.

Currently, I just include the .pl files in the "extras" directory of the distribution. This has the disadvantage that the files are not installed on make install . Is there any way to include them in the installation and where should they go? (They are not executable files and do not belong to "bin".) "Separate" the meaning? Or are these files usually simply not installed, and the user needs to exit the .tgz archive and use as necessary?

I use Dist :: Zilla to manage my distribution.

+8
perl
source share
3 answers

I liked @Joe's answer, except that in my case the files were WebWork macros - separate .pl files that make my module callable from WebWork end-user code. Therefore, they do not fit into any of the categories discussed here, and since .pl files cannot be created.

Here is what I did:

  • put all .pl macros in 'extras / WebWork' in the distribution.
  • add a stanza with the dir = extras property to the "dist.ini" a [ShareDir] file.
  • now the WebWork administrator can install my distribution from CPAN and then use perl -MFile::ShareDir -e 'print File::ShareDir::dist_dir("Statistics-R-IO")' to find the macros and make them available in WebWork .
0
source share

I would suggest the following:

  • If they are truly complete programs or nearly complete, polish them up and make them separate elements that can go into /bin with POD.
  • If this is utility glue, create the ::Utils module so that they can live and document their use.
  • If these are useful snippets of code, but not something that you can install somewhere, or these are usage examples or convenient idioms, create the ::Cookbook all-POD module and include them there with the appropriate lighting explanation for each of them.
+1
source share

I don’t know exactly how Dist :: Zilla works, but the resulting archive should be compatible with what ExtUtils :: MakeMaker creates.

When creating a module with module-starter it creates a module template using ExtUtils::MakeMaker . It creates several files and directories, such as the lib directory where your module lives, and the t directories in which your tests live.

One thing that it does not create is the bin directory. However, if you create the bin directory and put the files in this directory (for example, Perl scripts), these files will be installed in the bin in your Perl distribution and linked to /usr/local/bin or /usr/bin . good place for your scripts?

0
source share

All Articles