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


in reply to Re^2: What's the best way to handle the installation and or distribution of a Perl script?
in thread What's the best way to handle the installation and or distribution of a Perl script?

While there indeed are Modules that can perform the task of automating the task of creating a Dist for CPAN. Those that are specific to single utility type Perl scripts are somewhat few, by comparison. Those that do exist, are largely unfinished. In anticipation of releasing a full fledged, and complete Module for the automation of creating, and distributing of either a standard Perl Module, or Perl script(s). I initiated this endevour ~month ago. Searching for documentation, while available. Wasn't where I anticipated it's being, and was a bit chopped up. I then embarked on a search for Modules that either were "how-to's" (POD's, and such), or were complete Automation dists, for the sake of completely automating the task of creating, and pushing your dist to CPAN. As noted earlier, they existed. Those that worked best, were intended for a typical Perl Module. Those for scripts, while could work. Were best suited for those already comfortable using CPAN, and were already relatively seasoned authors.

So I thought my idea a worthy cause. It was my intention, after completion of the Module, to post an RFC in Meditations. Given that. I'll end much further discussion of it here. In order to keep things in context.

Given that my original intent was to elicit comments from others on how they would choose to create a dist on CPAN that was meerly a utility type script. I'll post the one I use (Makefile.PL). Hopefully, my submission might elicit the dialog I had hoped for. :)

use 5.008_005; use strict; use warnings FATAL => 'all'; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'examplescript', AUTHOR => q{Judy Garland <judygarland@wizard.oz>}, VERSION_FROM => 'lib/examplescript.pm', EXE_FILES => ['examplescript'], ABSTRACT_FROM => 'lib/examplescript.pm', LICENSE => 'artistic', PL_FILES => { # examplescript.pl }, MIN_PERL_VERSION => 5.008_005, CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => 0, }, BUILD_REQUIRES => { 'Test::More' => 0, }, PREREQ_PM => { 'File::Spec' => 0, 'Term::ReadLine' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'examplescript-*' }, );
While I didn't need to also create a examplescript.pm, I chose to, only to provide an additional "help file" (it only contains what would be dumped to the man files -- man.1, and man.3). It also contains a little bonus --
samplescript.pm exports nothing. Perhaps you're looking for the script examplescript(.pl) try perldoc examplescript for more information.
Anyway, it does the job quite adequately, and will/would pass the "smoke" test(s) on cpantesters.

That's all for now. :)

--Chris

#!/usr/bin/perl -Tw
use Perl::Always or die;
my $perl_version = (5.12.5);
print $perl_version;
  • Comment on Re^3: What's the best way to handle the installation and or distribution of a Perl script?
  • Select or Download Code