问题
The portable strawberry perl is a godsend-- I can bundle it into an NSIS installer along with the actual scripts and have the user double click it. However, I'm still having to install CPAN modules that our scripts need, manually on each user's computer.
Is there a portable way to 'inject' cpan modules into strawberry perl's portable version?
Would it be a good idea to take the portable strawberry on a development machine, install modules via CPAN, and re-zip it for distribution? (I imagine I'd need to fix the install location to c:\custom-perl or something if I do this). Anyone know of a more direct way? I suppose I should script the cpan commands into the installer, but it would be nice if the user didn't have to wait 20 minutes+ for the installer (which is how long it takes to compile all dependencies).
回答1:
I think if you use one of the CPAN tools (cpan/cpanp/cpanm) it should install just fine to Z:\<strawberry path>\perl\site\lib
and then you can pack the whole thing up.
来源:https://stackoverflow.com/questions/4825188/how-can-i-create-a-portable-strawberry-with-extra-bundled-modules