Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Module Installs

by talexb (Chancellor)
on Feb 28, 2002 at 15:14 UTC ( [id://148235]=note: print w/replies, xml ) Need Help??


in reply to Module Installs

I also came across this problem. I settled on figuring out how to install Perl modules on the account I have at my web provider (good old pair). If a reinstall of ActiveState helps then I will go that route.

Installing Perl modules when you're not root

  1. Get the archive from CPAN.
  2. Unpack the archive

    This is two steps: unzip (to go from Foo.tar.gz to Foo.tar), then untar into the lib directory in your current Perl installation.

  3. Build/install/unit test the module.

    This is a few steps too:

    1. perl Makefile.PL -- this builds Makefile for you.

      The problem I had in the past was that this points to the system's Perl installation, and that's no good for you if you're not root. The trick is you have to either edit the Makefile and change PREFIX to the name of the directory above lib to get the next steps to work.

      This is, of course :) obvious to well-seasoned Monks, but it's something I had to tinker with for a while before it worked -- I never came across instructions on how to install modules when you're not root.

      (Alternatively you can run perl Makefile.PL with the command line option PREFIX=[your Perl directory here]. I found out about that option later.)

    2. make -- This presumably does any compilation that's required.
    3. make install -- This presumably does any file copying that's required.
    4. make install -- This presumably does any further installation that's required.
    5. make clean -- This presumably does any cleanup that's required.

  4. Even after that's all done, your work is not over. When I untarred Spreadsheet-ParseExcel-0.2405 it went into a directory called Spreadsheet-ParseExcel-0.2405 but in my code I was asking for the module Spreadsheet::ParseExcel which failed, of course.

    I renamed the directory Spreadsheet-ParseExcel-0.2405 to Spreadsheet and I was able to use the module.

    (Of course, after that I ran into run-time memory problems, but that's another story.)

I hope this information is useful to any other Monks that want to install modules on a machine where they're not root -- or even if they are root, but don't want to install something system-wide.

ps This node written Thursday 1015 February 28; please allow a few days for this information to mature before rushing ahead and using it .. no doubt there will be clarifications and corrections.

Update 0830 Monday March 4: Thx to crazyinsomniac for also pointing out the CPAN module CPAN.pm which provides you with an automated way to get modules. Appropriate links are CPAN module page on CPAN and local CPAN manpage.

I was aware of this but wanted to know about the nuts and bolts of the proper method .. but I will probably use CPAN the next time.

--t. alex

"There was supposed to be an earth-shattering kaboom!" --Marvin the Martian

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://148235]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-18 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found