You may want to consider minicpan (provided buy CPAN::Mini) to create and maintain an 'offline' cpan mirror. I do this for work, use the tool to create a mirror on a machine with internet access, transfer it to our offline network, point cpan/cpanm towards the files.
To export all modules etc just run cpan -a to create an 'autobundle'.pm package, which you can copy elsewhere and apply via perl -MCPAN -e 'install Bundle::Snapshot_2024_08_13_00'.
| [reply] [d/l] [select] |
Personally, I also use CPAN::Mini, but there also is Pinto, which aims for fine-grained control of what versions you import into your server. I never got it to run, but I didn't spend much time on it either, since I have a working CPAN::Mini installation already.
The "downside" of CPAN::Mini is, that it always keeps a complete mirror and always has the latest version. There is very little in customizing distributions or adding your own, internal modules to it. There is CPAN::Mini::Inject for that, but I've never used it.
| [reply] |
CPAN::Mini::Inject works quite well. It has a somewhat strange array of command line options, but they are well explained and easy to understand (just hard to remember).
The biggest hurdle to get a local CPAN mirror going these days is the regretable descission of some (not top be named here) people regarding the topic "Mirrors are a thing of the past, we'll do everything in our power to curtail the use of CPAN mirrors". That has unfortunately caused the cpan shell to have a somewhat worse support for local mirrors.
It's been some time since i last my local mirror, but it boiled down to having extra steps to configure the cpan shell, and running (if i remember correctly) into problems with signatures. In that instance, i ended up running a patched version of the cpan shell that disabled some security checks...
| [reply] |