Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Adding modules to a PC manually

by SeigePerlous (Novice)
on Oct 15, 2011 at 18:24 UTC ( #931683=perlquestion: print w/replies, xml ) Need Help??
SeigePerlous has asked for the wisdom of the Perl Monks concerning the following question:

I'm not real familiar with what all ppm does when you install a new module. We have a test system that cannot be connected to the internet so in order to add new Perl modules on the system I need a manual method. Is there a reasonable method of installing the modules to another PC and copying them to the test system PC? I've tried this but my script still says the subroutine I'm calling can't be found. Does Perl maintain some kind of module registry that I need to update so this module is "known" to the interpreter? Thanks.

Replies are listed 'Best First'.
Re: Adding modules to a PC manually
by sundialsvc4 (Abbot) on Oct 16, 2011 at 13:48 UTC

    It is essential that, if you are using ActiveState and its package-system, you must confine yourself to using that system:   do not muddy-the-waters either with CPAN or with direct installs from .gz files.   (The packaging system would thereby be caused to lose track of what is actually happening, of course, and much entirely-avoidable grief would ensue.)   Even if you must “sneaker-net” the package files to a computer that has no network connectivity at all, you must install packages, and nothing else.

      This makes great sense but what do I do when I am using ActiveState and ppm does not install PDL correctly? I have to find some way of "fixing" the install and I've found nothing to date.
Re: Adding modules to a PC manually
by pvaldes (Chaplain) on Oct 15, 2011 at 18:46 UTC

    Download the package in another computer connected to internet in the desired extension (probably a .zip file), copy to a pendrive, take the pendrive to your house, then extract and install the package in your system with something like this:


    cd /a_package


      No this is not right if this is an Active State installation.

      An Active State module is completely compiled and "read to go " module for Windows (or actually Lunix or OS X) is a .ppd file. Down load that file to a jump drive, CD, DVD or whatever.

      type>ppm help install

      basically: ppm> install X:\module.ppd

      where X:\ is the jump drive or CD root

      Things are more complicated if you are not using Active State. The Active State .ppd file is "ready to go" - no nmake or compiler is needed. No build process. You are done in less than a minute. Some big critters will require more .ppd files that the target .ppd file depends upon. If that happens, then download more .ppd files, on the same media and ppm will find them - rinse repeat.

      There are multiple repositories for .ppd files, the largest in on the Active State site. Building an Active State .ppd yourself can be mess, but it usually not necessary. You have to have the right compiler (VC6 or mingw) and that can be a mess. These are available as a download able .ppd, but I strongly recommend against it. Go with the flow and do the easy thing.

        It appears the only file ppm downloaded was into my PDL folder. There is no .ppd file. I have copied this file to the target computer's PDL folder but my script still tells me it can't find it.

        There is documentation on Util that says "PDL::Util does not export anything by default. A list of symbols may be imported as usual. The exportable symbols come in two types, functions (tag :function) and methods (tag :methods).
        The word methods here is a strange word. When importing symbols one does not import methods. In this context a 'method' is a function which expects a piddle as its first argument. However, there is a reason ... If an array reference or hash reference is passed as the last item in the import list, the reference will be passed to the add_pdl_method function below, in which case these functions are imported into the PDL namespace and may be used as method calls.
        Note, when doing this for symbols from the PDL::Util module, only those listed in the :methods tag may be added as a method (this is the origin of the confusing terminology). "
        I tried adding
        PDL::Util::add_pdl_method({'getArray' => 'unroll'});
        but then I get the error "Referenced methods or constants a package doesn't define: Util::add_pdl_method"

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-06-23 11:54 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.