Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: What's the best way to handle the installation and or distribution of a Perl script?

by Laurent_R (Parson)
on Nov 24, 2013 at 23:09 UTC ( #1064157=note: print w/ replies, xml ) Need Help??


in reply to What's the best way to handle the installation and or distribution of a Perl script?

Thank you for asking the question, Chris, I'll watch the answers carefully.

I have a similar problem. I have written about a dozen modules in the recent past, but all of them were too specific to our company's needs to justify the idea of publishing them on the CPAN or elsewhere. But I wrote relatively recently a module for comparing large data files which I think may be useful to other users. This module can remove duplicate records, find and remove "orphans" (records in one file and not the other) and then compare the data. I have used that module in two different contexts, and it does what is needed and I think it works well. And I wrote it at home on my free time, so that I can really make it public domain or free software or whatever other adequate free access license.

My main problem, though, is that I do not know how to do a CPAN distri. Especially, I do not know how to provide test cases that will work with Unix files, Windows files, VMS files and so on.


Comment on Re: What's the best way to handle the installation and or distribution of a Perl script?
Re^2: What's the best way to handle the installation and or distribution of a Perl script?
by taint (Chaplain) on Nov 24, 2013 at 23:47 UTC
    Merci pour tes mots gentils, Laurent_R.
    I hope I stated that properly. :)

    My current thoughts on this is (given the script contains POD), is to copy all of the documentation from it into a Perl Module. Then simply following the normal course of creating, and distributing a Perl Module. So the final results being: somescript.pl
    SomeScript.pm
    I already have a Makefile.PL to do that. But thought I'd wait to post it. To see what other thoughts, ideas, implementations others had, first.

    Merci encore.

    --Chris

    #!/usr/bin/perl -Tw
    use Perl::Always or die;
    my $perl_version = (5.12.5);
    print $perl_version;

      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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064157]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-12-21 08:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls