Re: [install and use local::lib module]

Maxim Abalenkov <[email protected]> Thu, 15 Feb 2024 10:23:23 +0000
Newsgroups gmane.comp.lang.perl.beginners
Message-ID <[email protected]>
Dear all,

How are you? I re-read the README file of the local::lib module. There was one more command missing:

echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >>~/.bashrc

My new Perl settings in the .profile file are:

# Perl 5.38
export PATH=/usr/local/bin:$PATH
export PERL5LIB=$HOME/perl5/lib/perl5
eval `perl -I$HOME/perl5/lib/perl5 -Mlocal::lib`

Now everything works. But I still don’t understand the setup very well. What is the difference between the ‘.cpan’ and ‘perl5’ directories? What is their purpose? Thank you and have a great day ahead!

—
Best wishes,
Maxim

Maxim Abalenkov \\ [email protected]
+44 7 486 486 505 \\ www.maxim.abalenkov.uk

> On 15 Feb 2024, at 10:12, Maxim Abalenkov <[email protected]> wrote:
> 
> Dear all,
> 
> How are you? I hope all is well with you. I need help please. I recently moved to a new laptop and installed Perl 5.38.2 from source. I would like to discipline myself and learn how to use the ‘local::lib’ module properly. I downloaded the source code of local::lib from cpan website and installed it with:
> 
>   perl Makefile.PL —bootstrap
>   make install
> 
> It installed correctly. However, when I try to use this module in my script with:
> 
>  use local::lib
> 
> My program crashes with the following error message:
> 
> Can't locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC entries checked: /Users/mabalenk/.cpan /usr/local/lib/perl5/site_perl/5.38.2/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.38.2 /usr/local/lib/perl5/5.38.2/darwin-thread-multi-2level /usr/local/lib/perl5/5.38.2) at /Users/mabalenk/bin/upg-macports.pl line 14.
> BEGIN failed--compilation aborted at /Users/mabalenk/bin/upg-macports.pl line 14.
> 
> These are the environment variables that I set in my .profile file:
> 
>   # Perl 5.38
>   export PATH=/usr/local/bin:$PATH
>   export PERL5LIB=$HOME/.cpan
> 
> I can see the “local::lib” files with:
> 
> find .cpan -name "local"
> .cpan/build/local-lib-2.000029-2/blib/arch/auto/local
> .cpan/build/local-lib-2.000029-2/blib/lib/POD2/PT_BR/local
> .cpan/build/local-lib-2.000029-2/blib/lib/POD2/DE/local
> .cpan/build/local-lib-2.000029-2/blib/lib/auto/local
> .cpan/build/local-lib-2.000029-2/blib/lib/local
> .cpan/build/local-lib-2.000029-2/lib/POD2/PT_BR/local
> .cpan/build/local-lib-2.000029-2/lib/POD2/DE/local
> .cpan/build/local-lib-2.000029-2/lib/local
> .cpan/build/local-lib-2.000029-1/blib/arch/auto/local
> .cpan/build/local-lib-2.000029-1/blib/lib/POD2/PT_BR/local
> .cpan/build/local-lib-2.000029-1/blib/lib/POD2/DE/local
> .cpan/build/local-lib-2.000029-1/blib/lib/auto/local
> .cpan/build/local-lib-2.000029-1/blib/lib/local
> .cpan/build/local-lib-2.000029-1/lib/POD2/PT_BR/local
> .cpan/build/local-lib-2.000029-1/lib/POD2/DE/local
> .cpan/build/local-lib-2.000029-1/lib/local
> .cpan/build/local-lib-2.000029-0/blib/arch/auto/local
> .cpan/build/local-lib-2.000029-0/blib/lib/POD2/PT_BR/local
> .cpan/build/local-lib-2.000029-0/blib/lib/POD2/DE/local
> .cpan/build/local-lib-2.000029-0/blib/lib/auto/local
> .cpan/build/local-lib-2.000029-0/blib/lib/local
> .cpan/build/local-lib-2.000029-0/lib/POD2/PT_BR/local
> .cpan/build/local-lib-2.000029-0/lib/POD2/DE/local
> .cpan/build/local-lib-2.000029-0/lib/local
> 
> But they are in the “build” directory. This is a little bit suspicious. Am I missing some installation steps? Would you please help me to install “local::lib” correctly? Thank you very much and have a wonderful day ahead!
> 
> —
> Best wishes,
> Maxim
> 
> Maxim Abalenkov \\ [email protected]
> +44 7 486 486 505 \\ www.maxim.abalenkov.uk