The algorithm is fairly simple:
- Gather all prerequisites of your top level module(s)
- While you have found new prerequisites in the last step, gather their prerequisites as well, and prepend them to the list
- For every distribution in the list of prerequisites, do the following steps:
- Create a directory named after the distribution and version number
- For every file in the current distribution:
- Download the file
- Save the file in the corresponding directory below the above directory
- Install the distribution:
- Open a command prompt in the distribution directory
- Read the files INSTALL and README
- Run the following command
cpan .
or alternatively
cpanm . -L /the/directory/for/private/modules/
or alternatively
review local::lib.
This is basically everything you need to do if you cannot simply download the tarballs of the distributions. This is also what the cpan tool does. If you can also download tarballs, maybe simply create a directory structure like CPAN has and put the tarballs there. You can create and use a local CPAN mirror. See also CPAN::Mini and Pinto.