Supporting some Perl users recently with the need to install Perl CPAN modules (like “Tk” GUI Tool Kit) on Windows without direct access for perl cpan command to connect to any CPAN mirror servers (firewall or other connectivity issue).
In this case, it is still possible to install CPAN modules. Like Perl itself, “there is more than one way to do it” – this is one such way ;-).
- Assuming the Windows system already has “Strawberry Perl” distribution (contains gcc, perl, ptar, dmake, and other dependencies to build and use CPAN modules).
- Download the *.tar.gz package from CPAN and transfer to your target system (may require sneaker-net like burning a cd/dvd if lacking Internet connectivity).
- Extract the bundle using
ptar -zxf PKG-NAME.tar.gzor similar command within Strawberry Perl
cdinto the extracted package directory
- Build the package using standard commands – usually described in
INSTALLfile. Example typical for “Tk” module follows.
- An optional test program will also be available after successful build with
Good luck with your offline Perl CPAN module Windows build and install tasks. Hopefully this quick Strawberry Perl note will prove useful to those without direct connectivity to CPAN. Another possible solution may be to provide a “Mini-CPAN” for local module distribution as recommended by @mfontani on superuser.com: How do I install … [perl] module (.tar.gz file) in Windows?