If I want to distribute a Perl script, what is the best way to painlessly install any required modules that are missing on the user's system? Extra credit if there is a way to even install/upgrade Perl itself if it is missing or "too old".
相关问题
- $ENV{$variable} in perl
- Is it possible to pass command-line arguments to @
- Redirecting STDOUT and STDERR to a file, except fo
- Change first key of multi-dimensional Hash in perl
- How do I get a filehandle from the command line?
相关文章
- Override env values defined in container spec
- Running a perl script on windows without extension
- Comparing speed of non-matching regexp
- Can NOT List directory including space using Perl
- Extracting columns from text file using Perl one-l
- Lazy (ungreedy) matching multiple groups using reg
- How do I tell DBD::mysql where mysql.sock is?
- What is a good way to deploy a Perl application?
If you look at cpanminus, this you can install by simply executing one file:
curl -L http://cpanmin.us | perl - --self-upgrade
This might be the behaviour you're looking for; it's done with App::Fatpacker. Check it out:
https://metacpan.org/module/App::FatPacker
A semi-automated script taken from here , which should work for people with middle level bash skills and almost 0 level perl skills :
Auto-installing software is the best way to make both end users and sysadmins very angry with you. Forget about this approach.
You can simply ship all your dependencies with your application distro, the
inc
directory is customary.Usually this ends with CPAN-like package creation. So, when you need to install all dependencies you type
make installdeps
See perldoc perlmodlib Also
Module::Install
may be useful for you and some Makefile.PL exampleMakefile.PL
allows you to define deps and required perl version. Also you may addTo your script in order to require minimal version of perl to run. See perldoc -f use for details.
Why not use pp (PAR Packager) that creates an executable. No need for Perl or anything on the target machine.