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

I was thinking of including some exes (executable files) in a cpan distribution of a module. Does cpan allow exes? Where should I include them in the distribution? Should I just create an EXE directory? Thanks.

Replies are listed 'Best First'.
Re: Including exes in a cpan dist
by elmex (Friar) on Apr 20, 2008 at 11:48 UTC

    I don't know whether CPAN has a no-binary policy (if you really going to include compiled binaries :), I tried to look that up but couldn't find anything. So I would like to forward that question to other monks :) But executable Perl scripts should be no problem at all.

    About files: yes, putting the executables in a special directory will work, eg. exe/ or bin/. But note: If you want that exe to be installed with your module you have to adjust Makefile.PL (or Build.PL, or whatever you use for your module).

    If my module comes with executable scripts I usually put them in a bin/ directory and adjust the Makefile.PL like this (I'm using MakeMaker):

    use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'BS', # ... EXE_FILES => [qw(bin/bs bin/bsxmpp bin/bsirc bin/bshttp +bin/prelay bin/bslogparse bin/bsconf)], #... );

    With that the scripts/binaries are installed when the module is installed. I hope this helped a bit?

      Yes, it did. Thanks.