in reply to Problem with DynaLoader and "use"ing downloaded modules

The easiest way to install modules from CPAN is with the CPAN module that comes with perl.
perl -MCPAN -e 'install Foo::Bar'
will install the module Foo::Bar compiling anything that needs to be compiled for XS modules, and putting everything in the right place.

If you are not the admin for the system, you can install Perl modules in your local home dir as well. There are some directions for doing so in perlfaq8.

Replies are listed 'Best First'.
Re: Re: Problem with DynaLoader and "use"ing downloaded modules
by bnanaboy (Beadle) on Jul 25, 2003 at 14:45 UTC
    Sadly, due to memory constraints in place on the system (I work for a university), I can't run CPAN myself, so I would have to have my boss run CPAN for any modules I need installed, which is a big hassle for both of us. Which is why I was downloading the modules from CPAN online instead of using the CPAN module to install new modules. Each module I was trying to install is a single .pm file, no package, no Makefiles, etc. just a single .pm file.

      Sadly, due to memory constraints in place on the system (I work for a university), I can't run CPAN myself

      I'm sorry, what? Does the CPAN shell really take up that much more memory than any other Perl script on your system? (It doesn't appear to on mine.) CPAN is just a Perl module, just like any other Perl module. It almost seems like you maybe think you have to run a local CPAN mirror to use the cpan shell. You don't.

      Each module I was trying to install is a single .pm file, no package, no Makefiles, etc. just a single .pm file.

      Then you're not downloading the distribution correctly from the CPAN website. All (or as near as makes no difference) of the distributions available there are tar-balls that contain a Makefile.PL to install with. Search for the module to install on the website I linked (eg, Term::ReadKey, Crypt::Passwd, or Digest::MD5), click the distribution link (the smaller link underneath the main module name), and click the Download link on that page. You will get the .tar.gz file which contains the Makefile.PL. See the other comments in this thread on how to install from there (including sauoq's suggestion on using PREFIX).

      bbfu
      Black flowers blossom
      Fearless on my breath

        ++bbfu! You found my problem. I was downloading the actual .pm file for each module, not the tarred/gzipped distro. After downloading, unzipping, and making the module, I can successfully use the modules now.

        As for running a CPAN mirror, that was not the case. I can run the CPAN shell, and it would configure and start downloading modules, but every time it started compiling the module, I would get an out of memory error. CPAN seems to auto-update (the version installed on our system is 1.59, and I think the current version is 1.71?) before it will download any other modules, and would always crash when attempting compile the new version of CPAN.