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


In reply to Re: Module Installs by talexb
in thread Module Installs by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.