Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Installing CPAN modules without using 'ppm'

by LittleGreyCat (Scribe)
on Jun 23, 2006 at 11:15 UTC ( #557143=perlquestion: print w/replies, xml ) Need Help??
LittleGreyCat has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I am a Perl 'basic user' i.e. do a lot with very little.
I am now advancing a little and trying to use CPAN modules.
I am working under Windows (mainly Win2K but also W2K3) with ActiveState 5.8.8.
I want to add CPAN modules such as Net::Telnet, and perl-ldap.

My main problem is that I am working on corporate systems that are behind an 'air gap' so I do not have direct Internet access.

I started by downloading the modules in '.tar.gz' format, transferring them, unpacking them, and using the recommended combination of 'MakeMaker' and 'nmake'.
This worked O.K. on Net::Telnet but choked badly on perl-ldap.
After puzzling and Googling for a while, I wondered if nobody did this anymore.

On my home system I tried the recommended 'perl -MCPAN -e "install Bundle::Net::LDAP"' and similar.
This seemed to get further, but still choked on various things, often in an obscure manner.
Further confusion because CPAN told me it wasn't up to date and suggested that I installed the newer version.
I tried that, which had failures in the install using the previous CPAN.
I then tried 'ppm' and everything went smoothly first time (although 'ppm' didn't seem aware of stuff such as Net::Telnet that I had installed previously using 'perl -MCPAN -e "install Net::Telnet").

So I can work smoothly with 'ppm' at home - but not on my 'air-gapped' systems.

I have searched and found various references which suggest that all may not be simple on Windows with CPAN.

Am I chasing a known fault, or am I just cursed?
What is the best way to install CPAN modules on systems which are not connected to the Internet?

Many thanks
Dave R

  • Comment on Installing CPAN modules without using 'ppm'

Replies are listed 'Best First'.
Re: Installing CPAN modules without using 'ppm'
by holli (Monsignor) on Jun 23, 2006 at 12:23 UTC
Re: Installing CPAN modules without using 'ppm'
by xdg (Monsignor) on Jun 23, 2006 at 11:39 UTC

    You might consider using Mini::CPAN and its minicpan utility on a computer with internet access to create a small mirror of the latest files on CPAN. Burn that to a CD or two and bring it to the machine with the air gap.

    You can set your CPAN repository url to file://path/to/mini/cpan file://localhost/path/to/mini/cpan in the CPAN config file and it will use your CPAN mirror as if you were connected to the internet.


    In response to a chatterbox comment about the URL format, here's what I use in my CPAN (with the mini-cpan repository in C:\cpan):

    'urllist' => [ q[file:///C:/cpan] ],

    It's equivalent to:

    'urllist' => [ q[file://localhost/C:/cpan] ],


    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      Thanks for the suggestion about Mini::CPAN.
      I thought I was sorted, but today on further testing I have realised that I was hopelessly over-optimistic.
      I have just twigged that a 'ppm' repository and a 'CPAN' repository seem to be different, even though you can find modules from CPAN in the ActiveState 'ppm' repository.
      My original problem was that I couldn't install some modules downloaded from CPAN and also couldn't install some modules interactively using 'MCPAN'. However I could install using 'ppm'.

      I hadn't realised that 'ppm' uses the ActiveState repository and not the CPAN mirrors.
      So far I haven't found the descrition on how to download the ActiveState 'ppm' repository for local use or how to convert a CPAN repository (with the 'author' tree and '.tar.gz.') into a 'ppm' repository by adding 'ppd' files.

      I may have to backtrack and fix my CPAN problems after all.

      Dave R

Re: Installing CPAN modules without using 'ppm'
by Herkum (Parson) on Jun 23, 2006 at 11:23 UTC
    You can find the archives for ActiveState modules from their repository, on their website here. You download the modules that you need from here.

    All the files are in a ZIP format. Unzip the file and the installation instructions are in the README file.

      Thanks for the pointer.
      I am now building myself (I hope) a local 'ppm' repository.
      Having downloaded one ZIP file and unzipped it I see that I get a 'ppd' file in my top directory plus a '.tar.gz' file in a subdirectory.
      The README tells me I just have to run 'ppm' in the top directory.
      Logic (an uncertain tool) suggests that if I download all the ZIP files to a directory, unzip them all then delete the zip files (or unzip to a different target directory) I should then have a local 'ppm' repository.
      We shall see.
      Now wondering why there isn't a download of 'all modules'; perhaps I just haven't found it yet.
      Could there be a 'ppm::mini' to match 'CPAN::mini'?

      Thanks for all the help so far
      Dave R

        yes iam having same problem while installing .ihave created local repo +sitory .but i downloaded from +ath-Pari.tar.gz but i could find any ppd please tell where i can download find the Math::Pari
Re: Installing CPAN modules without using 'ppm'
by marto (Bishop) on Jun 23, 2006 at 11:36 UTC
    Hi LittleGreyCat,

    Can you be more specific, and perhaps show the errors you experienced when building these modules? You may want to check out the CPAN::Mini module, along with merlyn's article Mirroring your own mini-CPAN.

    Are you tied to ActiveState? If not you may be interested in PxPerl:

    "PXPerl lets you install new modules with the Perl built-in cpan script. No need for proprietary packages containing modules binaries, like ActivePerl. You can basically choose whatever module you want from CPAN and install it. If the module requires a C compiler, then PXPerl configures it for you. You can choose among these compilers: MinGW, Microsoft C++ Compiler, and Intel C++ Compiler."

    Hope this helps.

        I should note that the recommended solution at the moment for "Win32 + CPAN" is the "CamelPack", which is a macro-installer that downloads and installs ActivePerl, nmake, and MinGW, then integrates them together properly.

        Please note that Win32 is still making the transition from PPM being the most common installation method to having CPAN installation as a viable option, and so your milage may vary a little.

        Personally, I would recommend it only for experienced Perl people at the moment, as there are quite a few bugs in common modules that remain unresolved.

        To download the CamelPack, and for all other Win32 information, see the website.
Re: Installing CPAN modules without using 'ppm'
by jdtoronto (Prior) on Jun 23, 2006 at 12:50 UTC
    Some good suggestions in the earlier replies.

    I use the technique Holli suggested of running a mini-repository of my own. I have a machine which I use for testing. I install new versions of modules on it using PPM. If a module tests out okay in our environment, we move a copy of it to the repository, then anyone can install it - but nobody developing for me is allowed to install from anywhere else.

    Windows and CPAN can be difficult, but it is not impossible. There is another node here which talks about installing modules generally and it has some instructionson dealing with CPAN and C compilers on Windows. If you look ta the node Holli linked to you will find a link to the other node there somewhere.


Re: Installing CPAN modules without using 'ppm'
by VSarkiss (Monsignor) on Jun 23, 2006 at 13:57 UTC
      thank you for your suggestion; however the 'air gap' is just that.
      There is no connection to the Internet at all (nasty, insecure, dangerous thing that Internet).
      My strategy has to be to move data on physical media (such as CD) across the airgap.
      Working on the other helpful posts at present to establish a disc-based repository for local use of 'ppm'.
      Dave R

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://557143]
Approved by Corion
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2017-03-25 02:42 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (310 votes). Check out past polls.