Click here to get back home

CPAN module local installation question

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
CPAN module local installation question Ronald Fischer 07-12-2006
Posted by Ronald Fischer on July 12, 2006, 4:49 am
Please log in for more thread options


It's the first time that I am doing a *local* install of a CPAN
module, and promptly stumbled over a problem:

Using /tmp/foo as a destination directory for playing around,
Following the documentation on

http://search.cpan.org/~jhi/perl-5.8.0/pod/perlmodinstall.pod)

(I mention this because, as you will see below, it might be
that this documentation is incorrect about local installation),
I did:

perl Makefile.PL PREFIX=/tmp/foo
make
make install

which worked fine and produced, as expected:

$ du /tmp/foo
68 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List/MoreUtils
72 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List
76 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto
24 /tmp/foo/lib/site_perl/5.8.3/i686-linux/List
104 /tmp/foo/lib/site_perl/5.8.3/i686-linux
108 /tmp/foo/lib/site_perl/5.8.3
112 /tmp/foo/lib/site_perl
8 /tmp/foo/lib/5.8.3/i686-linux
12 /tmp/foo/lib/5.8.3
128 /tmp/foo/lib
28 /tmp/foo/man/man3
32 /tmp/foo/man
164 /tmp/foo

Also, the module was installed at the expected place:

$ find /tmp/foo -name '*pm'
/tmp/foo/lib/site_perl/5.8.3/i686-linux/List/MoreUtils.pm

Now the aforementioned CPAN page says:

'Type
perl Makefile.PL PREFIX=/my/perl_directory
to install it locally. (Remember that if you do this, you'll have to put
use lib "/my/perl_directory"; near the top of the program that is to use
this module.'

So I tried the following to test my installation:

$ perl -e 'use lib "/tmp/foo"; use List::MoreUtils;'
Can't locate List/MoreUtils.pm in @INC (@INC contains: /tmp/foo
/usr/local/perl5.8.3/lib/5.8.3/i686-linux /usr/local/perl5.8.3/lib/5.8.3
/usr/local/perl5.8.3/lib/site_perl/5.8.3/i686-linux
/usr/local/perl5.8.3/lib/site_perl/5.8.3
/usr/local/perl5.8.3/lib/site_perl .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

Of course if I do the test in the following way:

perl -e 'use lib "/tmp/foo/lib/site_perl/5.8.3/i686-linux"; use
List::MoreUtils;'

it works, but from what the CPAN documentation site suggests, it
should be sufficient to specify in @INC the parent of the lib directory.

Did I do something wrong? Is this an error in the documentation on the
CPAN site?

Ronald


--
Posted via http://www.newsoffice.de/


Posted by Stephan Titard on July 12, 2006, 5:59 am
Please log in for more thread options


Ronald Fischer escribió:
> It's the first time that I am doing a *local* install of a CPAN
> module, and promptly stumbled over a problem:
>
> Using /tmp/foo as a destination directory for playing around,
> Following the documentation on
>
> http://search.cpan.org/~jhi/perl-5.8.0/pod/perlmodinstall.pod)
>
> (I mention this because, as you will see below, it might be
> that this documentation is incorrect about local installation),
> I did:
>
> perl Makefile.PL PREFIX=/tmp/foo
> make
> make install
>
> which worked fine and produced, as expected:
>
> $ du /tmp/foo
> 68 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List/MoreUtils
> 72 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List
> 76 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto
> 24 /tmp/foo/lib/site_perl/5.8.3/i686-linux/List
> 104 /tmp/foo/lib/site_perl/5.8.3/i686-linux
> 108 /tmp/foo/lib/site_perl/5.8.3
> 112 /tmp/foo/lib/site_perl
> 8 /tmp/foo/lib/5.8.3/i686-linux
> 12 /tmp/foo/lib/5.8.3
> 128 /tmp/foo/lib
> 28 /tmp/foo/man/man3
> 32 /tmp/foo/man
> 164 /tmp/foo
>
> Also, the module was installed at the expected place:
>
> $ find /tmp/foo -name '*pm'
> /tmp/foo/lib/site_perl/5.8.3/i686-linux/List/MoreUtils.pm
>
> Now the aforementioned CPAN page says:
>
> 'Type
> perl Makefile.PL PREFIX=/my/perl_directory
> to install it locally. (Remember that if you do this, you'll have to put
> use lib "/my/perl_directory"; near the top of the program that is to use
> this module.'
>
> So I tried the following to test my installation:
>
> $ perl -e 'use lib "/tmp/foo"; use List::MoreUtils;'
> Can't locate List/MoreUtils.pm in @INC (@INC contains: /tmp/foo
> /usr/local/perl5.8.3/lib/5.8.3/i686-linux /usr/local/perl5.8.3/lib/5.8.3
> /usr/local/perl5.8.3/lib/site_perl/5.8.3/i686-linux
> /usr/local/perl5.8.3/lib/site_perl/5.8.3
> /usr/local/perl5.8.3/lib/site_perl .) at -e line 1.
> BEGIN failed--compilation aborted at -e line 1.
>
> Of course if I do the test in the following way:
>
> perl -e 'use lib "/tmp/foo/lib/site_perl/5.8.3/i686-linux"; use
> List::MoreUtils;'
>
> it works, but from what the CPAN documentation site suggests, it
> should be sufficient to specify in @INC the parent of the lib directory.
>
> Did I do something wrong? Is this an error in the documentation on the
> CPAN site?
>
> Ronald
>
>
does it help to include the lib subdir too?
I mean: "/tmp/foo/lib"
--stephan

Posted by Mumia W. on July 12, 2006, 8:07 am
Please log in for more thread options


On 07/12/2006 04:59 AM, Stephan Titard wrote:
> Ronald Fischer escribió:
>> It's the first time that I am doing a *local* install of a CPAN
>> module, and promptly stumbled over a problem:
>>
>> Using /tmp/foo as a destination directory for playing around,
>> Following the documentation on
>>
>> http://search.cpan.org/~jhi/perl-5.8.0/pod/perlmodinstall.pod)
>>
>> (I mention this because, as you will see below, it might be
>> that this documentation is incorrect about local installation),
>> I did:
>>
>> perl Makefile.PL PREFIX=/tmp/foo
>> make
>> make install
>>
>> which worked fine and produced, as expected:
>>
>> $ du /tmp/foo
>> 68 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List/MoreUtils
>> 72 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List
>> 76 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto
>> 24 /tmp/foo/lib/site_perl/5.8.3/i686-linux/List
>> 104 /tmp/foo/lib/site_perl/5.8.3/i686-linux
>> 108 /tmp/foo/lib/site_perl/5.8.3
>> 112 /tmp/foo/lib/site_perl
>> 8 /tmp/foo/lib/5.8.3/i686-linux
>> 12 /tmp/foo/lib/5.8.3
>> 128 /tmp/foo/lib
>> 28 /tmp/foo/man/man3
>> 32 /tmp/foo/man
>> 164 /tmp/foo
>>
>> Also, the module was installed at the expected place:
>>
>> $ find /tmp/foo -name '*pm'
>> /tmp/foo/lib/site_perl/5.8.3/i686-linux/List/MoreUtils.pm
>>
>> Now the aforementioned CPAN page says:
>>
>> 'Type
>> perl Makefile.PL PREFIX=/my/perl_directory
>> to install it locally. (Remember that if you do this, you'll have to
>> put use lib "/my/perl_directory"; near the top of the program that is
>> to use this module.'
>>
>> So I tried the following to test my installation:
>>
>> $ perl -e 'use lib "/tmp/foo"; use List::MoreUtils;'
>> Can't locate List/MoreUtils.pm in @INC (@INC contains: /tmp/foo
>> /usr/local/perl5.8.3/lib/5.8.3/i686-linux
>> /usr/local/perl5.8.3/lib/5.8.3
>> /usr/local/perl5.8.3/lib/site_perl/5.8.3/i686-linux
>> /usr/local/perl5.8.3/lib/site_perl/5.8.3
>> /usr/local/perl5.8.3/lib/site_perl .) at -e line 1.
>> BEGIN failed--compilation aborted at -e line 1.
>>
>> Of course if I do the test in the following way:
>>
>> perl -e 'use lib "/tmp/foo/lib/site_perl/5.8.3/i686-linux"; use
>> List::MoreUtils;'
>>
>> it works, but from what the CPAN documentation site suggests, it
>> should be sufficient to specify in @INC the parent of the lib directory.
>>
>> Did I do something wrong? Is this an error in the documentation on the
>> CPAN site?
>>
>> Ronald
>>
>>
> does it help to include the lib subdir too?
> I mean: "/tmp/foo/lib"
> --stephan

"Perldoc perlmodinstall" suggests that only /tmp/foo is
necessary when, in fact, /tmp/foo/lib is required, e.g.

$ perl -Mlib=/tmp/foo -MList::MoreUtils -e 1

fails when perlmodinstall suggests it should succeed.
Instead you must do this:

$ perl -Mlib=/tmp/foo/lib -MList::MoreUtils -e 1

IMO (in my opinion), it's a document bug in
perlmodinstall.pod, but it's not as grand as what Mr.
Fischer was thinking.


Posted by Mumia W. on July 12, 2006, 3:14 pm
Please log in for more thread options


On 07/12/2006 07:07 AM, Mumia W. wrote:
> On 07/12/2006 04:59 AM, Stephan Titard wrote:
>> Ronald Fischer escribió:
>>> It's the first time that I am doing a *local* install of a CPAN
>>> module, and promptly stumbled over a problem:
>>>
>>> Using /tmp/foo as a destination directory for playing around,
>>> Following the documentation on
>>>
>>> http://search.cpan.org/~jhi/perl-5.8.0/pod/perlmodinstall.pod)
>>>
>>> (I mention this because, as you will see below, it might be
>>> that this documentation is incorrect about local installation),
>>> I did:
>>>
>>> perl Makefile.PL PREFIX=/tmp/foo
>>> make
>>> make install
>>>
>>> which worked fine and produced, as expected:
>>>
>>> $ du /tmp/foo
>>> 68 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List/MoreUtils
>>> 72 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto/List
>>> 76 /tmp/foo/lib/site_perl/5.8.3/i686-linux/auto
>>> 24 /tmp/foo/lib/site_perl/5.8.3/i686-linux/List
>>> 104 /tmp/foo/lib/site_perl/5.8.3/i686-linux
>>> 108 /tmp/foo/lib/site_perl/5.8.3
>>> 112 /tmp/foo/lib/site_perl
>>> 8 /tmp/foo/lib/5.8.3/i686-linux
>>> 12 /tmp/foo/lib/5.8.3
>>> 128 /tmp/foo/lib
>>> 28 /tmp/foo/man/man3
>>> 32 /tmp/foo/man
>>> 164 /tmp/foo
>>>
>>> Also, the module was installed at the expected place:
>>>
>>> $ find /tmp/foo -name '*pm'
>>> /tmp/foo/lib/site_perl/5.8.3/i686-linux/List/MoreUtils.pm
>>>
>>> Now the aforementioned CPAN page says:
>>>
>>> 'Type
>>> perl Makefile.PL PREFIX=/my/perl_directory
>>> to install it locally. (Remember that if you do this, you'll have to
>>> put use lib "/my/perl_directory"; near the top of the program that is
>>> to use this module.'
>>>
>>> So I tried the following to test my installation:
>>>
>>> $ perl -e 'use lib "/tmp/foo"; use List::MoreUtils;'
>>> Can't locate List/MoreUtils.pm in @INC (@INC contains: /tmp/foo
>>> /usr/local/perl5.8.3/lib/5.8.3/i686-linux
>>> /usr/local/perl5.8.3/lib/5.8.3
>>> /usr/local/perl5.8.3/lib/site_perl/5.8.3/i686-linux
>>> /usr/local/perl5.8.3/lib/site_perl/5.8.3
>>> /usr/local/perl5.8.3/lib/site_perl .) at -e line 1.
>>> BEGIN failed--compilation aborted at -e line 1.
>>>
>>> Of course if I do the test in the following way:
>>>
>>> perl -e 'use lib "/tmp/foo/lib/site_perl/5.8.3/i686-linux"; use
>>> List::MoreUtils;'
>>>
>>> it works, but from what the CPAN documentation site suggests, it
>>> should be sufficient to specify in @INC the parent of the lib directory.
>>>
>>> Did I do something wrong? Is this an error in the documentation on the
>>> CPAN site?
>>>
>>> Ronald
>>>
>>>
>> does it help to include the lib subdir too?
>> I mean: "/tmp/foo/lib"
>> --stephan
>
> "Perldoc perlmodinstall" suggests that only /tmp/foo is necessary when,
> in fact, /tmp/foo/lib is required, e.g.
>
> $ perl -Mlib=/tmp/foo -MList::MoreUtils -e 1
>
> fails when perlmodinstall suggests it should succeed. Instead you must
> do this:
>
> $ perl -Mlib=/tmp/foo/lib -MList::MoreUtils -e 1
>

I was wrong. This works:

$ perl -Mlib=/tmp/foo/lib/perl -MList::MoreUtils -e 1

> IMO (in my opinion), it's a document bug in perlmodinstall.pod, but it's
> not as grand as what Mr. Fischer was thinking.
>

Now I don't know what to think. For me, MoreUtils.pm
was put into a different location:

(inside /tmp/foo)
> $ find . -name '*.pm'
> ./lib/perl/5.8.4/List/MoreUtils.pm

?


Posted by Sherm Pendley on July 12, 2006, 9:05 am
Please log in for more thread options



> Also, the module was installed at the expected place:
>
> $ find /tmp/foo -name '*pm'
> /tmp/foo/lib/site_perl/5.8.3/i686-linux/List/MoreUtils.pm
>
> Now the aforementioned CPAN page says:
>
> 'Type
> perl Makefile.PL PREFIX=/my/perl_directory
> to install it locally. (Remember that if you do this, you'll have to
> put use lib "/my/perl_directory"; near the top of the program that is
> to use this module.'
>
> So I tried the following to test my installation:
>
> $ perl -e 'use lib "/tmp/foo"; use List::MoreUtils;'
> Can't locate List/MoreUtils.pm in @INC (@INC contains: /tmp/foo
> /usr/local/perl5.8.3/lib/5.8.3/i686-linux
> /usr/local/perl5.8.3/lib/5.8.3
> /usr/local/perl5.8.3/lib/site_perl/5.8.3/i686-linux
> /usr/local/perl5.8.3/lib/site_perl/5.8.3
> /usr/local/perl5.8.3/lib/site_perl .) at -e line 1.
> BEGIN failed--compilation aborted at -e line 1.
>
> Of course if I do the test in the following way:
>
> perl -e 'use lib "/tmp/foo/lib/site_perl/5.8.3/i686-linux"; use
> List::MoreUtils;'
>
> it works, but from what the CPAN documentation site suggests, it
> should be sufficient to specify in @INC the parent of the lib directory.

You should be able to "use lib '/tmp/foo/lib/site_perl';" - the version
and architecture directory should be added automagically by the lib pragma.

Using PREFIX changes the base directory, but doesn't change the layout of the
directories under it. That layout still makes a distinction between Core and
CPAN modules, even when you're only installing CPAN modules.

> Did I do something wrong? Is this an error in the documentation on the
> CPAN site?

I suppose it's technically correct, in that a module might be configured to
install in the directory for core modules. It's certainly misleading though,
and doesn't apply to the most common case.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Similar ThreadsPosted
Local installation of perl module September 5, 2005, 9:07 am
Use CPAN or CPAN::Shell for LOCAL ONLY install from tarballs? May 9, 2008, 1:04 pm
ExtUtils::MakeMaker installation question January 15, 2005, 11:38 am
test failures during cpan installation July 12, 2006, 12:11 pm
General question on CPAN perl modules March 13, 2005, 6:34 pm
download Modules from CPAN and then load into Perl Question October 15, 2004, 3:07 pm
Module to return Local Policy Info July 13, 2008, 1:50 pm
HOWTO - do local ppm module install (fix "Could not locate a PPDfile") July 9, 2005, 5:25 pm
Perl module installation April 11, 2005, 9:55 am
Override System Module With Newer Local Version (noob) February 2, 2006, 7:36 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap