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!
Simply mark them as dependencies for your script. When he installs your script, cpan
/ cpanm
will automatically install them too if needed.
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 ).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.