0

I'm writing a script that uses some CPAN modules. What can I do so that co-workers can use my script without manually installing these CPAN modules?

Thanks!

Q-bertsuit
  • 3,223
  • 6
  • 30
  • 55
  • 4
    possible duplicate of [Can a Perl script install its own CPAN dependencies?](http://stackoverflow.com/questions/7664829/can-a-perl-script-install-its-own-cpan-dependencies) Or [Is it possible to manually include a CPAN library in a Perl script?](http://stackoverflow.com/questions/4214047/is-it-possible-to-manually-include-a-cpan-library-in-a-perl-script?rq=1) – Brian Roach Jan 03 '13 at 16:45

2 Answers2

2

Simply mark them as dependencies for your script. When he installs your script, cpan/cpanm will automatically install them too if needed.

ikegami
  • 367,544
  • 15
  • 269
  • 518
0

If it's going to be shipped and installed, I definitely recommend packaging as a CPAN-style distribution with dependencies declared in the normal way (modules of note: Dist::Zilla, Module::Build, ExtUtils::MakeMaker.

However, there may be the odd occasion when shipping the dependencies with the script itself is desirable. For pure-perl dependencies and having played around a little bit, App::FatPacker seems to work OK (cpanm uses it itself).

Unk
  • 1,103
  • 6
  • 11