|
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
?
|