Re: [install and use local::lib module]
[email protected] (Maxim Abalenkov) Thu, 15 Feb 2024 10:23:23 +0000
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_711870E0-12BF-4D4B-AFB7-5A1E5955729B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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=3D/usr/local/bin:$PATH export PERL5LIB=3D$HOME/perl5/lib/perl5 eval `perl -I$HOME/perl5/lib/perl5 -Mlocal::lib` Now everything works. But I still don=E2=80=99t understand the setup = very well. What is the difference between the =E2=80=98.cpan=E2=80=99 = and =E2=80=98perl5=E2=80=99 directories? What is their purpose? Thank = you and have a great day ahead! =E2=80=94 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: >=20 > Dear all, >=20 > 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 = =E2=80=98local::lib=E2=80=99 module properly. I downloaded the source = code of local::lib from cpan website and installed it with: >=20 > perl Makefile.PL =E2=80=94bootstrap > make install >=20 > It installed correctly. However, when I try to use this module in my = script with: >=20 > use local::lib >=20 > My program crashes with the following error message: >=20 > 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. >=20 > These are the environment variables that I set in my .profile file: >=20 > # Perl 5.38 > export PATH=3D/usr/local/bin:$PATH > export PERL5LIB=3D$HOME/.cpan >=20 > I can see the =E2=80=9Clocal::lib=E2=80=9D files with: >=20 > 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 >=20 > But they are in the =E2=80=9Cbuild=E2=80=9D directory. This is a = little bit suspicious. Am I missing some installation steps? Would you = please help me to install =E2=80=9Clocal::lib=E2=80=9D correctly? Thank = you very much and have a wonderful day ahead! >=20 > =E2=80=94 > Best wishes, > Maxim >=20 > Maxim Abalenkov \\ [email protected] > +44 7 486 486 505 \\ www.maxim.abalenkov.uk --Apple-Mail=_711870E0-12BF-4D4B-AFB7-5A1E5955729B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"content-type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;">Dear = all,<div><br></div><div>How are you? I re-read the README file of the = local::lib module. There was one more command = missing:</div><div><br></div><div>echo 'eval "$(perl = -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' = >>~/.bashrc</div><div><br></div><div>My new Perl settings in the = .profile file are:</div><div><br></div><div><div># Perl = 5.38</div><div>export PATH=3D/usr/local/bin:$PATH</div><div>export = PERL5LIB=3D$HOME/perl5/lib/perl5</div><div>eval `perl = -I$HOME/perl5/lib/perl5 -Mlocal::lib`</div></div><div><br></div><div>Now = everything works. But I still don=E2=80=99t understand the setup very = well. What is the difference between the =E2=80=98.cpan=E2=80=99 and = =E2=80=98perl5=E2=80=99 directories? What is their purpose? Thank you = and have a great day ahead!</div><div><br></div><div>=E2=80=94</div><div>B= est wishes,</div><div>Maxim</div><div><br = id=3D"lineBreakAtBeginningOfMessage"><div> <meta charset=3D"UTF-8"><div dir=3D"auto" style=3D"caret-color: rgb(0, = 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: = none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, = 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: = none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div>Maxim Abalenkov = \\ [email protected]<br>+44 7 486 486 505 = \\ www.maxim.abalenkov.uk</div></div></div> </div> <div><br><blockquote type=3D"cite"><div>On 15 Feb 2024, at 10:12, Maxim = Abalenkov <[email protected]> wrote:</div><br = class=3D"Apple-interchange-newline"><div><meta http-equiv=3D"content-type"= content=3D"text/html; charset=3Dutf-8"><div style=3D"overflow-wrap: = break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div dir=3D"auto" style=3D"overflow-wrap: = break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div dir=3D"auto" style=3D"overflow-wrap: = break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div dir=3D"auto" style=3D"overflow-wrap: = break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;">Dear all,<div><br></div><div>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 =E2=80=98local::lib=E2=80=99 module properly. I = downloaded the source code of local::lib from cpan website and installed = it with:</div><div><br></div><div> perl Makefile.PL = =E2=80=94bootstrap</div><div> make = install</div><div><br></div><div>It installed correctly. However, when I = try to use this module in my script = with:</div><div><br></div><div> use = local::lib</div><div><br></div><div>My program crashes with the = following error message:</div><div><br></div><div><div>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.</div><div>BEGIN failed--compilation aborted at = /Users/mabalenk/bin/upg-macports.pl line = 14.</div></div><div><br></div><div>These are the environment variables = that I set in my .profile file:</div><div><br></div><div><div> # = Perl 5.38</div><div> export = PATH=3D/usr/local/bin:$PATH</div><div> export = PERL5LIB=3D$HOME/.cpan</div></div><div><br></div><div>I can see the = =E2=80=9Clocal::lib=E2=80=9D files = with:</div><div><br></div><div><div>find .cpan -name = "local"</div><div>.cpan/build/local-lib-2.000029-2/blib/arch/auto/local</d= iv><div>.cpan/build/local-lib-2.000029-2/blib/lib/POD2/PT_BR/local</div><d= iv>.cpan/build/local-lib-2.000029-2/blib/lib/POD2/DE/local</div><div>.cpan= /build/local-lib-2.000029-2/blib/lib/auto/local</div><div>.cpan/build/loca= l-lib-2.000029-2/blib/lib/local</div><div>.cpan/build/local-lib-2.000029-2= /lib/POD2/PT_BR/local</div><div>.cpan/build/local-lib-2.000029-2/lib/POD2/= DE/local</div><div>.cpan/build/local-lib-2.000029-2/lib/local</div><div>.c= pan/build/local-lib-2.000029-1/blib/arch/auto/local</div><div>.cpan/build/= local-lib-2.000029-1/blib/lib/POD2/PT_BR/local</div><div>.cpan/build/local= -lib-2.000029-1/blib/lib/POD2/DE/local</div><div>.cpan/build/local-lib-2.0= 00029-1/blib/lib/auto/local</div><div>.cpan/build/local-lib-2.000029-1/bli= b/lib/local</div><div>.cpan/build/local-lib-2.000029-1/lib/POD2/PT_BR/loca= l</div><div>.cpan/build/local-lib-2.000029-1/lib/POD2/DE/local</div><div>.= cpan/build/local-lib-2.000029-1/lib/local</div><div>.cpan/build/local-lib-= 2.000029-0/blib/arch/auto/local</div><div>.cpan/build/local-lib-2.000029-0= /blib/lib/POD2/PT_BR/local</div><div>.cpan/build/local-lib-2.000029-0/blib= /lib/POD2/DE/local</div><div>.cpan/build/local-lib-2.000029-0/blib/lib/aut= o/local</div><div>.cpan/build/local-lib-2.000029-0/blib/lib/local</div><di= v>.cpan/build/local-lib-2.000029-0/lib/POD2/PT_BR/local</div><div>.cpan/bu= ild/local-lib-2.000029-0/lib/POD2/DE/local</div><div>.cpan/build/local-lib= -2.000029-0/lib/local</div></div><div><br></div><div>But they are in the = =E2=80=9Cbuild=E2=80=9D directory. This is a little bit suspicious. Am I = missing some installation steps? Would you please help me to install = =E2=80=9Clocal::lib=E2=80=9D correctly? Thank you very much and have a = wonderful day ahead!</div><div><br></div><div>=E2=80=94</div><div>Best = wishes,</div><div>Maxim</div><div><br></div></div></div></div><div> <meta charset=3D"UTF-8"><div dir=3D"auto" style=3D"caret-color: rgb(0, = 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: = break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, = 0); letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: = break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;"><div>Maxim Abalenkov = \\ [email protected]<br>+44 7 486 486 505 = \\ www.maxim.abalenkov.uk</div></div></div></div></div></div></blockq= uote></div><br></div></body></html>= --Apple-Mail=_711870E0-12BF-4D4B-AFB7-5A1E5955729B--