[Chicago-talk] "I don't have permission to installamoduleonthesystem!"

petemar1 petemar1 at perlmonk.org
Tue Dec 30 05:36:32 CST 2003

"It's alive." Thanks to all!

-----Original Message-----
From: chicago-talk-bounces at mail.pm.org
[mailto:chicago-talk-bounces at mail.pm.org]On Behalf Of Mike Fragassi
Sent: Monday, December 29, 2003 10:08 PM
To: Chicago.pm chatter
Subject: RE: [Chicago-talk] "I don't have permission to

On Mon, 29 Dec 2003, petemar1 wrote:

> Does anyone have a sample .cpan file?

First, the file is not ~/.cpan, but ~/.cpan/CPAN/MyConfig.pm.
Second, the argument that you need is

  'makepl_arg' => q[PREFIX=/your/home/dir/here],

Allegedly you can make do with '~', but I seem to have had some problems
with that.

If you do not already have the MyConfig.pm file, simply locate the root
user's CPAN/Config.pm, and copy it to that location, and make the changes.
Also, once you've done that, replace all references to '/root/' with
'/your/home/dir/here', except for the paths of executables, like lynx,
make, ftp, etc.

(Note that PREFIX is really an argument for ExtUtils::MakeMaker, and gets
passed to the 'perl Makefile.PL' stage.  If you ever find yourself having
to install a perl module outside of the CPAN shell, i.e. by ftping a
module, untar/zipping it, etc., all you need to do is run 'perl
Makefile.PL PREFIX=/your/home' instead of 'perl Makefile.PL'; all the
other steps in the installation process don't need to be changed.  If you
have to do this often, just create a shell alias -- call it 'mymakeperl'
or something.

Also note that ExtUtils::MakeMaker "has issues"[1], and Module::Build
is being increasingly adopted as a replacement, much like CPANPLUS is
intended as a replacement of CPAN.pm.)

Finally, to use your new, personal ~/lib, be sure to set the following in
your .bash_profile (or whichever):


Or just make sure that all your programs 'use lib qw(/your/home/lib);'.

I highly recommend jumping through these hoops to avoid polluting the root
set of modules, even on systems where you do have root access.  Once I
upgraded to the latest copy of CGI.pm, only to discover that the upgrade
actually broke the way that -style parameters were used.  (I'm pretty sure
this has been fixed, incidentally.)  Because I only installed into my
~/lib, I could just nuke that and revert to the default module, and I
could breathe easy knowing I hadn't affected any other user's scripts.

Similarly, when editing MyConfig.pm, I recommend

	'prerequisites_policy' => q[ask],

and not 'follow'.

-- Mike F.


Chicago-talk mailing list
Chicago-talk at mail.pm.org

More information about the Chicago-talk mailing list