This is more an open discussion and a conclusion than a real question, hoping it can help someone sometime.
I was looking on how to make Perl module on an Internet disconnected server (otherwise the answer is quite simple: use cpan
), so the only option I have is to manually compile the modules downloaded from the Internet (CPAN or others) directly on the server.
The problem was that, on a standard Windows server, there is no compiler. So how do I make the modules?
If you look in your Strawberry Perl installation folder you will see a number of useful utilities, including the compilers
cpp.exe
,c++.exe
,gcc.exe
and make utilitiesgmake.exe
anddmake.exe
.dmake
andgcc
together support the use ofcpan
on your installation, andcpanm
is available as well.For information on the general process of installing a module, take a look at
perlmodinstall
Strawberry Perl includes the necessary compiler environment in the default installation, so compiling modules is no problem.
As for installing modules in an offline environment, I am highly partial to using
cpanmini
. Basically, you create a minimal mirror of all of CPAN using a machine with internet access, then throw that onto your offline machine. Change thecpan
program's settings to point to this local mirror. Now you can install nearly any module just like normal withcpan
.It may seem like overkill, but it is really very simple. The CPAN mirror takes up only about 2GB of space, which is nothing these days. You can put it on a USB stick, DVD, or whatever. And it is a once-for-all solution--the next time you want to install a module, it is already there.
Guys behind Strawberry were smart by packaging among with Perl binaries all you'll need under the
<Strawberry install dir>\c\bin
directory.Then, to compile a Perl module offline directly on a Windows server, the process is quite simple :
.tar.gz
filecmd
in the module directoryperl Makefile.PL
dmake
, look if there is no errordmake test
, look if there is no errordmake install
, look if there is no errorAnd you should be ok !
Don't hesitate to complete this article or to ask your questions in order to improve it.